From ab0d3c397493377eb98f9713fc669fb5ec72a45b Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Thu, 14 Mar 2019 20:39:24 +0100 Subject: fix backup creation for older installations If you had problems importing the backup you need to create a new backup after this patch --- src/main/java/de/pixart/messenger/persistance/DatabaseBackend.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/main/java/de/pixart/messenger/persistance/DatabaseBackend.java') diff --git a/src/main/java/de/pixart/messenger/persistance/DatabaseBackend.java b/src/main/java/de/pixart/messenger/persistance/DatabaseBackend.java index 8336a4ed9..e2c83321d 100644 --- a/src/main/java/de/pixart/messenger/persistance/DatabaseBackend.java +++ b/src/main/java/de/pixart/messenger/persistance/DatabaseBackend.java @@ -60,7 +60,7 @@ import rocks.xmpp.addr.Jid; public class DatabaseBackend extends SQLiteOpenHelper { public static final String DATABASE_NAME = "history"; - public static final int DATABASE_VERSION = 46; // = Conversations DATABASE_VERSION + 2 + public static final int DATABASE_VERSION = 47; // = Conversations DATABASE_VERSION + 3 private static DatabaseBackend instance = null; private static String CREATE_CONTATCS_STATEMENT = "create table " @@ -136,7 +136,6 @@ public class DatabaseBackend extends SQLiteOpenHelper { + SQLiteAxolotlStore.OWN + " INTEGER, " + SQLiteAxolotlStore.FINGERPRINT + " TEXT, " + SQLiteAxolotlStore.CERTIFICATE + " BLOB, " - + SQLiteAxolotlStore.TRUSTED + " TEXT, " + SQLiteAxolotlStore.TRUST + " TEXT, " + SQLiteAxolotlStore.ACTIVE + " NUMBER, " + SQLiteAxolotlStore.LAST_ACTIVATION + " NUMBER," @@ -554,7 +553,7 @@ public class DatabaseBackend extends SQLiteOpenHelper { db.execSQL(CREATE_MESSAGE_TYPE_INDEX); } - if (oldVersion < 46 && newVersion >= 46) { + if (oldVersion < 46 && newVersion == 46) { // only available for old database version 46 if (!isColumnExisting(db, SQLiteAxolotlStore.IDENTITIES_TABLENAME, SQLiteAxolotlStore.TRUSTED)) { db.execSQL("ALTER TABLE " + SQLiteAxolotlStore.IDENTITIES_TABLENAME + " ADD COLUMN " + SQLiteAxolotlStore.TRUSTED); // TODO - just to make old databases importable, column isn't needed at all } -- cgit v1.2.3