mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 11:39:42 +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) {
|
val MIGRATION_14_15 = object : Migration(14, 15) {
|
||||||
override fun migrate(db: SupportSQLiteDatabase) {
|
override fun migrate(db: SupportSQLiteDatabase) {
|
||||||
Log.i("Migrations", "Migrating 14 to 15")
|
Log.i("Migrations", "Migrating 14 to 15")
|
||||||
addisSensitive(db)
|
addIsSensitive(db)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val MIGRATION_15_16 = object : Migration(15, 16) {
|
val MIGRATION_15_16 = object : Migration(15, 16) {
|
||||||
override fun migrate(db: SupportSQLiteDatabase) {
|
override fun migrate(db: SupportSQLiteDatabase) {
|
||||||
Log.i("Migrations", "Migrating 15 to 16")
|
Log.i("Migrations", "Migrating 15 to 16")
|
||||||
addisImportant(db)
|
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")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -308,7 +297,7 @@ object Migrations {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun addisSensitive(db: SupportSQLiteDatabase) {
|
fun addIsSensitive(db: SupportSQLiteDatabase) {
|
||||||
try {
|
try {
|
||||||
db.execSQL(
|
db.execSQL(
|
||||||
"ALTER TABLE Conversations " +
|
"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) {
|
fun addTempMessagesSupport(db: SupportSQLiteDatabase) {
|
||||||
try {
|
try {
|
||||||
db.execSQL(
|
db.execSQL(
|
||||||
|
Loading…
Reference in New Issue
Block a user