Перенос из 3 лабы

This commit is contained in:
Dmitry
2026-11-09 21:34:03 +03:00
parent ec540a1a72
commit 034d5537cf
77 changed files with 3253 additions and 0 deletions
@@ -0,0 +1,10 @@
CREATE TABLE idempotency_keys (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id UUID NOT NULL REFERENCES users(id),
chat_id UUID NOT NULL REFERENCES chats(id),
idempotency_key VARCHAR(128) NOT NULL,
message_id UUID NOT NULL REFERENCES messages(id),
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
CONSTRAINT uq_idempotency_user_chat_key
UNIQUE (user_id, chat_id, idempotency_key)
);