mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 11:39:42 +01: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) {
|
val MIGRATION_12_13 = object : Migration(12, 13) {
|
||||||
override fun migrate(db: SupportSQLiteDatabase) {
|
override fun migrate(db: SupportSQLiteDatabase) {
|
||||||
Log.i("Migrations", "Migrating 12 to 13")
|
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 {
|
try {
|
||||||
db.execSQL(
|
db.execSQL(
|
||||||
"ALTER TABLE ChatMessages " +
|
"ALTER TABLE ChatMessages " +
|
||||||
@ -274,5 +274,23 @@ object Migrations {
|
|||||||
} catch (e: SQLException) {
|
} catch (e: SQLException) {
|
||||||
Log.i("Migrations", "Something went wrong when adding column referenceId to table ChatMessages")
|
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