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();