From de6e18ef4eb2aceeddfcba603efab70c8c1be88f Mon Sep 17 00:00:00 2001 From: Marcel Hibbe Date: Tue, 27 May 2025 15:25:08 +0200 Subject: [PATCH] minor refactoring Signed-off-by: Marcel Hibbe --- .../talk/data/source/local/Migrations.kt | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/com/nextcloud/talk/data/source/local/Migrations.kt b/app/src/main/java/com/nextcloud/talk/data/source/local/Migrations.kt index 0d250979c..e9a5b2832 100644 --- a/app/src/main/java/com/nextcloud/talk/data/source/local/Migrations.kt +++ b/app/src/main/java/com/nextcloud/talk/data/source/local/Migrations.kt @@ -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(