Update for core changes

This commit is contained in:
nielsandriesse
2020-07-29 09:04:24 +10:00
parent 69c00a2be0
commit 43acedd91b
3 changed files with 32 additions and 10 deletions

View File

@@ -84,8 +84,9 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper {
private static final int lokiV8 = 29;
private static final int lokiV9 = 30;
private static final int lokiV10 = 31;
private static final int lokiV11 = 32;
private static final int DATABASE_VERSION = lokiV10; // Loki - onUpgrade(...) must be updated to use Loki version numbers if Signal makes any database changes
private static final int DATABASE_VERSION = lokiV11; // 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;
@@ -146,6 +147,7 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper {
db.execSQL(LokiAPIDatabase.getCreateSessionRequestTimestampCacheCommand());
db.execSQL(LokiAPIDatabase.getCreateSessionRequestSentTimestampCacheCommand());
db.execSQL(LokiAPIDatabase.getCreateSessionRequestProcessedTimestampCacheCommand());
db.execSQL(LokiAPIDatabase.getCreateOpenGroupPublicKeyDBCommand());
db.execSQL(LokiPreKeyBundleDatabase.getCreateTableCommand());
db.execSQL(LokiPreKeyRecordDatabase.getCreateTableCommand());
db.execSQL(LokiMessageDatabase.getCreateMessageIDTableCommand());
@@ -597,6 +599,10 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper {
db.execSQL(LokiAPIDatabase.getCreateSessionRequestProcessedTimestampCacheCommand());
}
if (oldVersion < lokiV11) {
db.execSQL(LokiAPIDatabase.getCreateOpenGroupPublicKeyDBCommand());
}
db.setTransactionSuccessful();
} finally {
db.endTransaction();