mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 08:47:46 +00:00
Fix the caption database migration.
This commit is contained in:
parent
5d1fcdaded
commit
187d7b3e3a
@ -58,8 +58,9 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper {
|
||||
private static final int NOTIFICATION_CHANNELS = 12;
|
||||
private static final int SECRET_SENDER = 13;
|
||||
private static final int ATTACHMENT_CAPTIONS = 14;
|
||||
private static final int ATTACHMENT_CAPTIONS_FIX = 15;
|
||||
|
||||
private static final int DATABASE_VERSION = 14;
|
||||
private static final int DATABASE_VERSION = 15;
|
||||
private static final String DATABASE_NAME = "signal.db";
|
||||
|
||||
private final Context context;
|
||||
@ -299,6 +300,14 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper {
|
||||
db.execSQL("ALTER TABLE part ADD COLUMN caption TEXT DEFAULT NULL");
|
||||
}
|
||||
|
||||
// 4.30.8 included a migration, but not a correct CREATE_TABLE statement, so we need to add
|
||||
// this column if it isn't present.
|
||||
if (oldVersion < ATTACHMENT_CAPTIONS_FIX) {
|
||||
if (!columnExists(db, "part", "caption")) {
|
||||
db.execSQL("ALTER TABLE part ADD COLUMN caption TEXT DEFAULT NULL");
|
||||
}
|
||||
}
|
||||
|
||||
db.setTransactionSuccessful();
|
||||
} finally {
|
||||
db.endTransaction();
|
||||
|
Loading…
x
Reference in New Issue
Block a user