From eb662884f7a029e90ecff0d92e62c413132b477c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=BBerko?= Date: Fri, 15 Nov 2024 15:41:42 +0100 Subject: [PATCH] fix: primary key of conversation folder (#3108) --- .../db_user/com/wire/kalium/persistence/ConversationFolders.sq | 2 +- persistence/src/commonMain/db_user/migrations/91.sqm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/persistence/src/commonMain/db_user/com/wire/kalium/persistence/ConversationFolders.sq b/persistence/src/commonMain/db_user/com/wire/kalium/persistence/ConversationFolders.sq index db30fa8a9cd..724326e53ba 100644 --- a/persistence/src/commonMain/db_user/com/wire/kalium/persistence/ConversationFolders.sq +++ b/persistence/src/commonMain/db_user/com/wire/kalium/persistence/ConversationFolders.sq @@ -14,7 +14,7 @@ CREATE TABLE LabeledConversation ( FOREIGN KEY (conversation_id) REFERENCES Conversation(qualified_id) ON DELETE CASCADE ON UPDATE CASCADE, FOREIGN KEY (folder_id) REFERENCES ConversationFolder(id) ON DELETE CASCADE ON UPDATE CASCADE, - PRIMARY KEY (conversation_id, folder_id) + PRIMARY KEY (folder_id, conversation_id) ); getConversationsFromFolder: diff --git a/persistence/src/commonMain/db_user/migrations/91.sqm b/persistence/src/commonMain/db_user/migrations/91.sqm index b424e1cb704..0f8a5a4da56 100644 --- a/persistence/src/commonMain/db_user/migrations/91.sqm +++ b/persistence/src/commonMain/db_user/migrations/91.sqm @@ -15,5 +15,5 @@ CREATE TABLE LabeledConversation ( FOREIGN KEY (conversation_id) REFERENCES Conversation(qualified_id) ON DELETE CASCADE ON UPDATE CASCADE, FOREIGN KEY (folder_id) REFERENCES ConversationFolder(id) ON DELETE CASCADE ON UPDATE CASCADE, - PRIMARY KEY (conversation_id, folder_id) + PRIMARY KEY (folder_id, conversation_id) );