Сделана лаба 4

This commit is contained in:
2026-11-16 22:00:34 +03:00
parent ec540a1a72
commit de2246a888
19 changed files with 1437 additions and 40 deletions
+11
View File
@@ -0,0 +1,11 @@
CREATE TABLE idempotency_keys (
user_id uuid NOT NULL REFERENCES users(id) ON DELETE CASCADE,
chat_id uuid NOT NULL REFERENCES chats(id) ON DELETE CASCADE,
idempotency_key varchar(128) NOT NULL,
request_hash char(64) NOT NULL,
message_id uuid REFERENCES messages(id) ON DELETE CASCADE,
created_at timestamptz NOT NULL DEFAULT now(),
PRIMARY KEY (user_id, chat_id, idempotency_key)
);
CREATE INDEX idempotency_created_idx ON idempotency_keys(created_at);