Add id_file_key index to database
This commit is contained in:
+8
-1
@@ -61,8 +61,15 @@ bool Database::init(const QLatin1String &connectionName)
|
|||||||
query.exec("CREATE INDEX IF NOT EXISTS maxRa_idx ON fits_files(maxRa)");
|
query.exec("CREATE INDEX IF NOT EXISTS maxRa_idx ON fits_files(maxRa)");
|
||||||
query.exec("CREATE INDEX IF NOT EXISTS minDec_idx ON fits_files(minDec)");
|
query.exec("CREATE INDEX IF NOT EXISTS minDec_idx ON fits_files(minDec)");
|
||||||
query.exec("CREATE INDEX IF NOT EXISTS maxDec_idx ON fits_files(maxDec)");
|
query.exec("CREATE INDEX IF NOT EXISTS maxDec_idx ON fits_files(maxDec)");
|
||||||
|
version = 1;
|
||||||
}
|
}
|
||||||
else if(version > 1)
|
if(version == 1)
|
||||||
|
{
|
||||||
|
query.exec("CREATE INDEX IF NOT EXISTS id_file_key ON fits_headers(id_file, key)");
|
||||||
|
query.exec("PRAGMA user_version = 2");
|
||||||
|
version = 2;
|
||||||
|
}
|
||||||
|
if(version > 2)
|
||||||
{
|
{
|
||||||
qDebug() << "Database version is too new";
|
qDebug() << "Database version is too new";
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user