Skip to content

Commit

Permalink
add migration for hmac keys database
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Dec 4, 2024
1 parent 34427c9 commit 4d40363
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE IF EXISTS "hmac_key_records";
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CREATE TABLE "hmac_key_records"(
-- Group ID that the Hmac keys are associated with
"group_id" BLOB NOT NULL,
-- Dm ID that the Hmac keys are associated with
"dm_id" TEXT,
-- The hmac key
"hmac_key" BLOB NOT NULL,
-- The number of 30 day periods since epoch
"thirty_day_periods_since_epoch" INT NOT NULL,
PRIMARY KEY ("group_id", "hmac_key")
);
10 changes: 10 additions & 0 deletions xmtp_mls/src/storage/encrypted_store/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ diesel::table! {
}
}

diesel::table! {
hmac_key_records (group_id, hmac_key) {
group_id -> Binary,
dm_id -> Nullable<Text>,
hmac_key -> Binary,
thirty_day_periods_since_epoch -> Integer,
}
}

diesel::table! {
identity (rowid) {
inbox_id -> Text,
Expand Down Expand Up @@ -123,6 +132,7 @@ diesel::allow_tables_to_appear_in_same_query!(
group_intents,
group_messages,
groups,
hmac_key_records,
identity,
identity_updates,
key_package_history,
Expand Down

0 comments on commit 4d40363

Please sign in to comment.