From 1ce826844545dfaad7ec6979ef7c17800c10dd99 Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Mon, 26 Aug 2019 15:58:31 +1000 Subject: [PATCH] Add missing database migration --- .../securesms/database/helpers/SQLCipherOpenHelper.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/org/thoughtcrime/securesms/database/helpers/SQLCipherOpenHelper.java b/src/org/thoughtcrime/securesms/database/helpers/SQLCipherOpenHelper.java index 4c89afaf2e..34db34cf7e 100644 --- a/src/org/thoughtcrime/securesms/database/helpers/SQLCipherOpenHelper.java +++ b/src/org/thoughtcrime/securesms/database/helpers/SQLCipherOpenHelper.java @@ -72,8 +72,9 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper { private static final int RECIPIENT_FORCE_SMS_SELECTION = 19; private static final int JOBMANAGER_STRIKES_BACK = 20; private static final int STICKERS = 21; + private static final int lokiV1 = 22; - private static final int DATABASE_VERSION = 21; + private static final int DATABASE_VERSION = 22; // Loki - onUpgrade(...) must be updated to use Loki version numbers if Signal makes any database changes private static final String DATABASE_NAME = "signal.db"; private final Context context; @@ -485,6 +486,12 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper { db.execSQL("CREATE INDEX IF NOT EXISTS part_sticker_pack_id_index ON part (sticker_pack_id)"); } + if (oldVersion < lokiV1) { + db.execSQL(LokiAPIDatabase.getCreateGroupChatAuthTokenTableCommand()); + db.execSQL(LokiAPIDatabase.getCreateLastMessageServerIDTableCommand()); + db.execSQL(LokiAPIDatabase.getCreateFirstMessageServerIDTableCommand()); + } + db.setTransactionSuccessful(); } finally { db.endTransaction();