From ea6cb1af1c67a9c8201dd187c4ef9b81347e3a2d Mon Sep 17 00:00:00 2001 From: 0x330a <92654767+0x330a@users.noreply.github.com> Date: Mon, 14 Aug 2023 14:07:58 +1000 Subject: [PATCH] feat: add db migrations --- .../securesms/database/helpers/SQLCipherOpenHelper.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/database/helpers/SQLCipherOpenHelper.java b/app/src/main/java/org/thoughtcrime/securesms/database/helpers/SQLCipherOpenHelper.java index 89bda0994..1b65706a5 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/database/helpers/SQLCipherOpenHelper.java +++ b/app/src/main/java/org/thoughtcrime/securesms/database/helpers/SQLCipherOpenHelper.java @@ -88,9 +88,10 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper { private static final int lokiV40 = 61; private static final int lokiV41 = 62; private static final int lokiV42 = 63; + private static final int lokiV43 = 64; // Loki - onUpgrade(...) must be updated to use Loki version numbers if Signal makes any database changes - private static final int DATABASE_VERSION = lokiV42; + private static final int DATABASE_VERSION = lokiV43; private static final int MIN_DATABASE_VERSION = lokiV7; private static final String CIPHER3_DATABASE_NAME = "signal.db"; public static final String DATABASE_NAME = "signal_v4.db"; @@ -356,6 +357,7 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper { executeStatements(db, ReactionDatabase.CREATE_REACTION_TRIGGERS); db.execSQL(RecipientDatabase.getAddWrapperHash()); + db.execSQL(RecipientDatabase.getAddBlocksCommunityMessageRequests()); } @Override @@ -598,6 +600,10 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper { db.execSQL(RecipientDatabase.getAddWrapperHash()); } + if (oldVersion < lokiV43) { + db.execSQL(RecipientDatabase.getAddBlocksCommunityMessageRequests()); + } + db.setTransactionSuccessful(); } finally { db.endTransaction();