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(