From e5a0db878274e9061177d94d486367892ed9d0ef Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Tue, 21 Oct 2014 16:37:39 +0200 Subject: [PATCH] SyncJournalDB: Fix version table filling up --- src/mirall/syncjournaldb.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mirall/syncjournaldb.cpp b/src/mirall/syncjournaldb.cpp index 71ba1a9825..f01491ed3a 100644 --- a/src/mirall/syncjournaldb.cpp +++ b/src/mirall/syncjournaldb.cpp @@ -239,6 +239,12 @@ bool SyncJournalDb::checkConnect() if (!versionQuery.next()) { // If there was no entry in the table, it means we are likely upgrading from 1.5 _possibleUpgradeFromMirall_1_5 = true; + } else { + // Delete the existing entry so we can replace it by the new one + createQuery.prepare("DELETE FROM version;"); + if (!createQuery.exec()) { + return sqlFail("Remove version", createQuery); + } } createQuery.prepare("INSERT OR REPLACE INTO version (major, minor, patch) VALUES ( ?1, ?2 , ?3 );");