From 11a4738a4cbebab9ddf3e4f190fa8923b47bb115 Mon Sep 17 00:00:00 2001 From: Marcel Hibbe Date: Tue, 5 Nov 2024 14:37:58 +0100 Subject: [PATCH] fix addArchiveConversations migration method this will set NOT NULL and DEFAULT 0 to hasArchived column Otherwise there would be an error when updating from the previous DB version: IllegalStateException: Migration didn't properly handle: Conversations(com.nextcloud.talk.data.database.model.ConversationEntity) Signed-off-by: Marcel Hibbe --- .../java/com/nextcloud/talk/data/source/local/Migrations.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 e255357cb..b23e99fd4 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 @@ -250,7 +250,7 @@ object Migrations { try { db.execSQL( "ALTER TABLE Conversations " + - "ADD `hasArchived` INTEGER;" + "ADD COLUMN hasArchived INTEGER NOT NULL DEFAULT 0;" ) } catch (e: SQLException) { Log.i("Migrations", "hasArchived already exists")