From b7f1a0abc912c66af2abc6f3c0118560d20f40cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Du=C5=A1an=20Poizl?= Date: Sun, 22 Mar 2026 09:55:19 +0100 Subject: [PATCH] Add id_file_key index to database --- src/database.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/database.cpp b/src/database.cpp index 88ee995..b206861 100644 --- a/src/database.cpp +++ b/src/database.cpp @@ -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 minDec_idx ON fits_files(minDec)"); 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"; return false;