소스 검색

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 <dev@mhibbe.de>
Marcel Hibbe 5 달 전
부모
커밋
11a4738a4c
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      app/src/main/java/com/nextcloud/talk/data/source/local/Migrations.kt

+ 1 - 1
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")