summaryrefslogtreecommitdiff
path: root/plugins/Dbx_sqlite/src/dbintf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Dbx_sqlite/src/dbintf.cpp')
-rw-r--r--plugins/Dbx_sqlite/src/dbintf.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/Dbx_sqlite/src/dbintf.cpp b/plugins/Dbx_sqlite/src/dbintf.cpp
index b5e305c755..41b9a37383 100644
--- a/plugins/Dbx_sqlite/src/dbintf.cpp
+++ b/plugins/Dbx_sqlite/src/dbintf.cpp
@@ -46,7 +46,7 @@ int CDbxSQLite::Create()
logError(rc, __FILE__, __LINE__);
rc = sqlite3_exec(m_db, "CREATE TABLE events (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, contact_id INTEGER NOT NULL, module TEXT NOT NULL,"
- "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);", nullptr, nullptr, nullptr);
+ "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);
@@ -78,7 +78,7 @@ int CDbxSQLite::Create()
/////////////////////////////////////////////////////////////////////////////////////////
-#define CURRVER 5
+#define CURRVER 6
static bool g_bConversionOver = false;
@@ -199,6 +199,11 @@ void CDbxSQLite::CheckConversion()
logError(rc, __FILE__, __LINE__);
}
+ if (dbv.bVal < 6) {
+ int rc = sqlite3_exec(m_db, "ALTER TABLE events ADD COLUMN reply_id TEXT NULL;", 0, 0, 0);
+ logError(rc, __FILE__, __LINE__);
+ }
+
dbv.bVal = CURRVER;
WriteContactSetting(0, "Compatibility", "Sqlite", &dbv);