From ab82801448ed2e89e1387235f74ff37818767e2b Mon Sep 17 00:00:00 2001 From: steckbrief Date: Sat, 23 Apr 2016 22:45:22 +0200 Subject: Related to FS#134: check if oldversion is smaller then new version on upgrading c+ db --- .../de/thedevstack/conversationsplus/persistance/DatabaseBackend.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/de/thedevstack/conversationsplus/persistance/DatabaseBackend.java b/src/main/java/de/thedevstack/conversationsplus/persistance/DatabaseBackend.java index 738b78ad..5a5746d5 100644 --- a/src/main/java/de/thedevstack/conversationsplus/persistance/DatabaseBackend.java +++ b/src/main/java/de/thedevstack/conversationsplus/persistance/DatabaseBackend.java @@ -34,7 +34,6 @@ import java.util.concurrent.CopyOnWriteArrayList; import org.json.JSONException; import de.thedevstack.android.logcat.Logging; -import de.thedevstack.conversationsplus.BuildConfig; import de.thedevstack.conversationsplus.Config; import de.thedevstack.conversationsplus.crypto.axolotl.AxolotlServiceImpl; import de.thedevstack.conversationsplus.crypto.axolotl.SQLiteAxolotlStore; @@ -197,7 +196,7 @@ public class DatabaseBackend extends SQLiteOpenHelper { protected void onUpgradeCPlusDatabase(SQLiteDatabase db, int oldVersion, int newVersion) { Logging.d("db.upgrade.cplus", "Updating Conversations+ database from version '" + oldVersion + "' to '" + newVersion + "'"); - if (oldVersion != newVersion) { + if (oldVersion < newVersion) { if (oldVersion == 0 && newVersion == 1) { Logging.d("db.upgrade.cplus", "Creating additional parameters table for messages."); db.execSQL(MessageDatabaseAccess.TABLE_ADDITIONAL_PARAMETERS_CREATE_V0); -- cgit v1.2.3