diff options
author | George Hazan <george.hazan@gmail.com> | 2024-04-30 11:36:43 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-04-30 11:36:43 +0300 |
commit | 3f1e855bb32235c0122f9f992200691d8ea62fa8 (patch) | |
tree | c16698dd64d34742e6dbe1c959907381362647d0 /plugins/Dbx_sqlite | |
parent | a1298d902d4d684e3690f5b2cb3756b8e9eb9e03 (diff) |
SQLITE: useless index removed
Diffstat (limited to 'plugins/Dbx_sqlite')
-rw-r--r-- | plugins/Dbx_sqlite/src/dbintf.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/Dbx_sqlite/src/dbintf.cpp b/plugins/Dbx_sqlite/src/dbintf.cpp index dc872f64c7..7d3d06a1a5 100644 --- a/plugins/Dbx_sqlite/src/dbintf.cpp +++ b/plugins/Dbx_sqlite/src/dbintf.cpp @@ -29,7 +29,7 @@ CDbxSQLite::~CDbxSQLite() /////////////////////////////////////////////////////////////////////////////////////////
-#define CURRVER 6
+#define CURRVER 7
int CDbxSQLite::Create()
{
@@ -51,9 +51,6 @@ int CDbxSQLite::Create() "timestamp INTEGER NOT NULL, type INTEGER NOT NULL, flags INTEGER NOT NULL, data BLOB, server_id TEXT NULL, user_id TEXT NULL, is_read INTEGER NOT NULL DEFAULT 0, reply_id TEXT NULL);", nullptr, nullptr, nullptr);
logError(rc, __FILE__, __LINE__);
- rc = sqlite3_exec(m_db, "CREATE INDEX idx_events_contactid_timestamp ON events(contact_id, timestamp);", nullptr, nullptr, nullptr);
- logError(rc, __FILE__, __LINE__);
-
rc = sqlite3_exec(m_db, "CREATE INDEX idx_events_module_serverid ON events(module, server_id);", nullptr, nullptr, nullptr);
logError(rc, __FILE__, __LINE__);
@@ -204,6 +201,11 @@ void CDbxSQLite::CheckConversion() logError(rc, __FILE__, __LINE__);
}
+ if (dbv.bVal < 7) {
+ int rc = sqlite3_exec(m_db, "DROP INDEX IF EXISTS idx_events_contactid_timestamp;", 0, 0, 0);
+ logError(rc, __FILE__, __LINE__);
+ }
+
dbv.bVal = CURRVER;
WriteContactSetting(0, "Compatibility", "Sqlite", &dbv);
|