yurtaev - lab4

This commit is contained in:
yurtaev.va
2026-11-06 15:43:25 +03:00
parent ec540a1a72
commit 2a88f717f3
22 changed files with 1627 additions and 42 deletions
+10
View File
@@ -0,0 +1,10 @@
CREATE TABLE message_idempotency (
user_id uuid NOT NULL REFERENCES users(id),
chat_id uuid NOT NULL REFERENCES chats(id),
key varchar(128) NOT NULL,
body_hash bytea NOT NULL,
message_id uuid UNIQUE REFERENCES messages(id),
expires_at timestamptz NOT NULL,
PRIMARY KEY (user_id, chat_id, key)
);
CREATE INDEX message_idempotency_expiry_idx ON message_idempotency (expires_at);