-
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.
drop instead of move labeled conversations
- Loading branch information
Showing
1 changed file
with
3 additions
and
8 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 |
---|---|---|
@@ -1,15 +1,10 @@ | ||
CREATE TABLE LabeledConversation_New ( | ||
DROP TABLE LabeledConversation; | ||
|
||
CREATE TABLE LabeledConversation ( | ||
conversation_id TEXT AS QualifiedIDEntity NOT NULL, | ||
folder_id TEXT NOT NULL, | ||
|
||
FOREIGN KEY (folder_id) REFERENCES ConversationFolder(id) ON DELETE CASCADE ON UPDATE CASCADE, | ||
|
||
PRIMARY KEY (folder_id, conversation_id) | ||
); | ||
|
||
INSERT INTO LabeledConversation_New (conversation_id, folder_id) | ||
SELECT conversation_id, folder_id FROM LabeledConversation; | ||
|
||
DROP TABLE LabeledConversation; | ||
|
||
ALTER TABLE LabeledConversation_New RENAME TO LabeledConversation; |