mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-27 20:15:21 +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 NOTIFICATION_CHANNELS = 12;
|
||||||
private static final int SECRET_SENDER = 13;
|
private static final int SECRET_SENDER = 13;
|
||||||
private static final int ATTACHMENT_CAPTIONS = 14;
|
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 static final String DATABASE_NAME = "signal.db";
|
||||||
|
|
||||||
private final Context context;
|
private final Context context;
|
||||||
@ -299,6 +300,14 @@ public class SQLCipherOpenHelper extends SQLiteOpenHelper {
|
|||||||
db.execSQL("ALTER TABLE part ADD COLUMN caption TEXT DEFAULT NULL");
|
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();
|
db.setTransactionSuccessful();
|
||||||
} finally {
|
} finally {
|
||||||
db.endTransaction();
|
db.endTransaction();
|
||||||
|
Loading…
Reference in New Issue
Block a user