[+] Completed lab 3

This commit is contained in:
Антон Архипов
2026-11-16 16:15:08 +03:00
parent 0ab3a341aa
commit 98dd709eda
52 changed files with 4713 additions and 49 deletions
+10
View File
@@ -0,0 +1,10 @@
CREATE TABLE message_idempotency (
user_id uuid NOT NULL,
chat_id uuid NOT NULL,
idempotency_key text NOT NULL CHECK (idempotency_key ~ '^[A-Za-z0-9._:-]{1,128}$'),
request_hash text NOT NULL,
message_id uuid REFERENCES messages (id),
expires_at timestamptz(3) NOT NULL,
PRIMARY KEY (user_id, chat_id, idempotency_key),
FOREIGN KEY (chat_id, user_id) REFERENCES chat_members (chat_id, user_id)
);