From da7b64a35ee97c71e22c765490140650055d39cd Mon Sep 17 00:00:00 2001 From: Dakota Brink Date: Wed, 13 Nov 2024 16:21:38 -0500 Subject: [PATCH] add down --- .../down.sql | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/xmtp_mls/migrations/2024-11-13-145830_add_conversation_type_remove_purpose/down.sql b/xmtp_mls/migrations/2024-11-13-145830_add_conversation_type_remove_purpose/down.sql index d9a93fe9a..5649cb2bb 100644 --- a/xmtp_mls/migrations/2024-11-13-145830_add_conversation_type_remove_purpose/down.sql +++ b/xmtp_mls/migrations/2024-11-13-145830_add_conversation_type_remove_purpose/down.sql @@ -1 +1,10 @@ --- This file should undo anything in `up.sql` +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;