From cfdf2247edde03a552ee6658dae5316fc60cac5f 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 | 12 +++++++++++- 1 file changed, 11 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..ecc0cb7fb 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,11 @@ --- 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 = 1 THEN 1 + WHEN conversation_type = 2 THEN 1 + ELSE 2 +END; + +ALTER TABLE groups DROP COLUMN conversation_type;