mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-18 19:19:33 +01:00
minor refactoring
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
cb80034102
commit
de6e18ef4e
@ -65,25 +65,14 @@ object Migrations {
|
||||
val MIGRATION_14_15 = object : Migration(14, 15) {
|
||||
override fun migrate(db: SupportSQLiteDatabase) {
|
||||
Log.i("Migrations", "Migrating 14 to 15")
|
||||
addisSensitive(db)
|
||||
addIsSensitive(db)
|
||||
}
|
||||
}
|
||||
|
||||
val MIGRATION_15_16 = object : Migration(15, 16) {
|
||||
override fun migrate(db: SupportSQLiteDatabase) {
|
||||
Log.i("Migrations", "Migrating 15 to 16")
|
||||
addisImportant(db)
|
||||
}
|
||||
}
|
||||
|
||||
fun addisImportant(db: SupportSQLiteDatabase) {
|
||||
try {
|
||||
db.execSQL(
|
||||
"ALTER TABLE Conversations " +
|
||||
"ADD COLUMN hasImportant INTEGER NOT NULL DEFAULT 0;"
|
||||
)
|
||||
} catch (e: SQLException) {
|
||||
Log.i("Migrations", "Something went wrong when adding column hasImportant to table Conversations")
|
||||
addIsImportant(db)
|
||||
}
|
||||
}
|
||||
|
||||
@ -308,7 +297,7 @@ object Migrations {
|
||||
}
|
||||
}
|
||||
|
||||
fun addisSensitive(db: SupportSQLiteDatabase) {
|
||||
fun addIsSensitive(db: SupportSQLiteDatabase) {
|
||||
try {
|
||||
db.execSQL(
|
||||
"ALTER TABLE Conversations " +
|
||||
@ -319,6 +308,17 @@ object Migrations {
|
||||
}
|
||||
}
|
||||
|
||||
fun addIsImportant(db: SupportSQLiteDatabase) {
|
||||
try {
|
||||
db.execSQL(
|
||||
"ALTER TABLE Conversations " +
|
||||
"ADD COLUMN hasImportant INTEGER NOT NULL DEFAULT 0;"
|
||||
)
|
||||
} catch (e: SQLException) {
|
||||
Log.i("Migrations", "Something went wrong when adding column hasImportant to table Conversations")
|
||||
}
|
||||
}
|
||||
|
||||
fun addTempMessagesSupport(db: SupportSQLiteDatabase) {
|
||||
try {
|
||||
db.execSQL(
|
||||
|
Loading…
Reference in New Issue
Block a user