From 6c7910ede4ed15a23361f44190da91e4b1ce6329 Mon Sep 17 00:00:00 2001 From: cameronvoell Date: Wed, 18 Dec 2024 10:31:15 -0800 Subject: [PATCH] save group message content types --- .../2024-12-18-175338_messages_content_type/down.sql | 11 +++++++++++ .../2024-12-18-175338_messages_content_type/up.sql | 11 +++++++++++ xmtp_mls/src/storage/encrypted_store/schema.rs | 4 ++++ 3 files changed, 26 insertions(+) create mode 100644 xmtp_mls/migrations/2024-12-18-175338_messages_content_type/down.sql create mode 100644 xmtp_mls/migrations/2024-12-18-175338_messages_content_type/up.sql diff --git a/xmtp_mls/migrations/2024-12-18-175338_messages_content_type/down.sql b/xmtp_mls/migrations/2024-12-18-175338_messages_content_type/down.sql new file mode 100644 index 000000000..3c9d1a4ec --- /dev/null +++ b/xmtp_mls/migrations/2024-12-18-175338_messages_content_type/down.sql @@ -0,0 +1,11 @@ +ALTER TABLE group_messages + DROP COLUMN authority_id; + +ALTER TABLE group_messages + DROP COLUMN version_major; + +ALTER TABLE group_messages + DROP COLUMN version_minor; + +ALTER TABLE group_messages + DROP COLUMN content_type; diff --git a/xmtp_mls/migrations/2024-12-18-175338_messages_content_type/up.sql b/xmtp_mls/migrations/2024-12-18-175338_messages_content_type/up.sql new file mode 100644 index 000000000..fc3ace48f --- /dev/null +++ b/xmtp_mls/migrations/2024-12-18-175338_messages_content_type/up.sql @@ -0,0 +1,11 @@ +ALTER TABLE group_messages + ADD COLUMN content_type INTEGER NOT NULL DEFAULT 0; + +ALTER TABLE group_messages + ADD COLUMN version_minor INTEGER NOT NULL DEFAULT 0; + +ALTER TABLE group_messages + ADD COLUMN version_major INTEGER NOT NULL DEFAULT 0; + +ALTER TABLE group_messages + ADD COLUMN authority_id TEXT NOT NULL DEFAULT ''; diff --git a/xmtp_mls/src/storage/encrypted_store/schema.rs b/xmtp_mls/src/storage/encrypted_store/schema.rs index c82818161..9dba148f6 100644 --- a/xmtp_mls/src/storage/encrypted_store/schema.rs +++ b/xmtp_mls/src/storage/encrypted_store/schema.rs @@ -41,6 +41,10 @@ diesel::table! { sender_installation_id -> Binary, sender_inbox_id -> Text, delivery_status -> Integer, + content_type -> Integer, + version_minor -> Integer, + version_major -> Integer, + authority_id -> Text, } }