Skip to content

Commit

Permalink
fix addArchiveConversations migration method
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mahibi committed Nov 5, 2024
1 parent 4ff9b2b commit 11a4738
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 11a4738

Please sign in to comment.