ЛР 3 — БПИ2303 — Унру — на 3

This commit is contained in:
2026-11-13 00:23:23 +03:00
parent 0ab3a341aa
commit ee1a17dff6
53 changed files with 3237 additions and 25 deletions
+11
View File
@@ -0,0 +1,11 @@
-- Additive: old lab2 tables and messages remain valid.
CREATE TABLE idempotency_records (
user_id uuid NOT NULL REFERENCES users(id),
chat_id uuid NOT NULL REFERENCES chats(id),
key text NOT NULL CHECK (key ~ '^[A-Za-z0-9._:-]{1,128}$'),
request_hash text NOT NULL,
message_id uuid REFERENCES messages(id),
expires_at timestamptz NOT NULL,
PRIMARY KEY (user_id, chat_id, key)
);
CREATE INDEX idempotency_expiry_idx ON idempotency_records(expires_at);