mirror of
https://github.com/nextcloud/talk-android
synced 2025-03-07 06:39:45 +00:00
add DB migration
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
a58607b547
commit
4c795139ac
@ -51,7 +51,7 @@ object Migrations {
|
||||
val MIGRATION_12_13 = object : Migration(12, 13) {
|
||||
override fun migrate(db: SupportSQLiteDatabase) {
|
||||
Log.i("Migrations", "Migrating 12 to 13")
|
||||
addReferenceIdToChatMessages(db)
|
||||
addTempMessagesSupport(db)
|
||||
}
|
||||
}
|
||||
|
||||
@ -265,7 +265,7 @@ object Migrations {
|
||||
}
|
||||
}
|
||||
|
||||
fun addReferenceIdToChatMessages(db: SupportSQLiteDatabase) {
|
||||
fun addTempMessagesSupport(db: SupportSQLiteDatabase) {
|
||||
try {
|
||||
db.execSQL(
|
||||
"ALTER TABLE ChatMessages " +
|
||||
@ -274,5 +274,23 @@ object Migrations {
|
||||
} catch (e: SQLException) {
|
||||
Log.i("Migrations", "Something went wrong when adding column referenceId to table ChatMessages")
|
||||
}
|
||||
|
||||
try {
|
||||
db.execSQL(
|
||||
"ALTER TABLE ChatMessages " +
|
||||
"ADD COLUMN isTemporary INTEGER NOT NULL DEFAULT 0;"
|
||||
)
|
||||
} catch (e: SQLException) {
|
||||
Log.i("Migrations", "Something went wrong when adding column isTemporary to table ChatMessages")
|
||||
}
|
||||
|
||||
try {
|
||||
db.execSQL(
|
||||
"ALTER TABLE ChatMessages " +
|
||||
"ADD COLUMN sendingFailed INTEGER NOT NULL DEFAULT 0;"
|
||||
)
|
||||
} catch (e: SQLException) {
|
||||
Log.i("Migrations", "Something went wrong when adding column sendingFailed to table ChatMessages")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user