-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import com.wire.kalium.persistence.dao.QualifiedIDEntity; | ||
import com.wire.kalium.persistence.dao.conversation.folder.ConversationFolderTypeEntity; | ||
|
||
CREATE TABLE IF NOT EXISTS ConversationFolder ( | ||
id TEXT NOT NULL PRIMARY KEY, | ||
name TEXT NOT NULL, | ||
folder_type TEXT AS ConversationFolderTypeEntity NOT NULL | ||
); | ||
|
||
|
||
CREATE TABLE IF NOT EXISTS LabeledConversation ( | ||
conversation_id TEXT AS QualifiedIDEntity NOT NULL, | ||
folder_id TEXT NOT NULL, | ||
|
||
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 (folder_id, conversation_id) | ||
); |