-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove Purpose, Add Conversation Type to database. Sync sync groups w…
…hen syncing all groups too. (#1261) * logs * wip * cleanup * remove comment * syncable groups fix * revert this file * invert the approach * add down
- Loading branch information
Showing
16 changed files
with
113 additions
and
85 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
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
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
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
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
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
10 changes: 10 additions & 0 deletions
10
xmtp_mls/migrations/2024-11-13-145830_add_conversation_type_remove_purpose/down.sql
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,10 @@ | ||
ALTER TABLE groups | ||
ADD COLUMN purpose INTEGER NOT NULL; | ||
|
||
UPDATE groups | ||
SET purpose = CASE | ||
WHEN conversation_type = 3 THEN 2 | ||
ELSE 1 | ||
END; | ||
|
||
ALTER TABLE groups DROP COLUMN conversation_type; |
16 changes: 16 additions & 0 deletions
16
xmtp_mls/migrations/2024-11-13-145830_add_conversation_type_remove_purpose/up.sql
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,16 @@ | ||
ALTER TABLE groups | ||
ADD COLUMN conversation_type INTEGER NOT NULL; | ||
|
||
UPDATE groups | ||
SET conversation_type = CASE | ||
-- Purpose is conversation and is not a DM | ||
-- Then set to 1 (ConversationType::Group) | ||
WHEN purpose = 1 AND dm_inbox_id IS NULL THEN 1 | ||
-- Otherwise dm_inbox_id is not null | ||
-- Then set to 2 (ConversationType::Dm) | ||
WHEN purpose = 1 THEN 2 | ||
-- Otherwise this is a Sync Group | ||
ELSE 3 | ||
END; | ||
|
||
ALTER TABLE groups DROP COLUMN purpose; |
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
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
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
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
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
Oops, something went wrong.