feat: add db migrations
This commit is contained in:
parent
0ea0bc0377
commit
ea6cb1af1c
|
@ -88,9 +88,10 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper {
|
||||||
private static final int lokiV40 = 61;
|
private static final int lokiV40 = 61;
|
||||||
private static final int lokiV41 = 62;
|
private static final int lokiV41 = 62;
|
||||||
private static final int lokiV42 = 63;
|
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
|
// 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 int MIN_DATABASE_VERSION = lokiV7;
|
||||||
private static final String CIPHER3_DATABASE_NAME = "signal.db";
|
private static final String CIPHER3_DATABASE_NAME = "signal.db";
|
||||||
public static final String DATABASE_NAME = "signal_v4.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);
|
executeStatements(db, ReactionDatabase.CREATE_REACTION_TRIGGERS);
|
||||||
db.execSQL(RecipientDatabase.getAddWrapperHash());
|
db.execSQL(RecipientDatabase.getAddWrapperHash());
|
||||||
|
db.execSQL(RecipientDatabase.getAddBlocksCommunityMessageRequests());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -598,6 +600,10 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper {
|
||||||
db.execSQL(RecipientDatabase.getAddWrapperHash());
|
db.execSQL(RecipientDatabase.getAddWrapperHash());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (oldVersion < lokiV43) {
|
||||||
|
db.execSQL(RecipientDatabase.getAddBlocksCommunityMessageRequests());
|
||||||
|
}
|
||||||
|
|
||||||
db.setTransactionSuccessful();
|
db.setTransactionSuccessful();
|
||||||
} finally {
|
} finally {
|
||||||
db.endTransaction();
|
db.endTransaction();
|
||||||
|
|
Loading…
Reference in New Issue