Skip to content

Commit

Permalink
add a v2 conversation database
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Oct 17, 2024
1 parent 18ca7b7 commit 5891a42
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE IF EXISTS "v2_conversations";
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CREATE TABLE v2_conversations (
topic TEXT NOT NULL PRIMARY KEY,
created_at_ns BIGINT NOT NULL,
peer_address INTEGER NOT NULL,
envelope_bytes BLOB NOT NULL
);
12 changes: 11 additions & 1 deletion xmtp_mls/src/storage/encrypted_store/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ diesel::table! {
purpose -> Integer,
added_by_inbox_id -> Text,
welcome_id -> Nullable<BigInt>,
rotated_at_ns -> BigInt,
dm_inbox_id -> Nullable<Text>,
rotated_at_ns -> BigInt,
}
}

Expand Down Expand Up @@ -107,6 +107,15 @@ diesel::table! {
}
}

diesel::table! {
v2_conversations (topic) {
topic -> Text,
created_at_ns -> BigInt,
peer_address -> Integer,
envelope_bytes -> Binary,
}
}

diesel::joinable!(group_intents -> groups (group_id));
diesel::joinable!(group_messages -> groups (group_id));

Expand All @@ -122,4 +131,5 @@ diesel::allow_tables_to_appear_in_same_query!(
openmls_key_store,
openmls_key_value,
refresh_state,
v2_conversations,
);

0 comments on commit 5891a42

Please sign in to comment.