перенос основы 3 лабы

This commit is contained in:
Ванек
2026-11-05 18:17:44 +03:00
parent ec540a1a72
commit 5c9b3e206a
56 changed files with 7969 additions and 22 deletions
+10
View File
@@ -0,0 +1,10 @@
-- Добавочная миграция: существующие данные и таблицы lab2 сохраняются.
CREATE TABLE message_idempotency (
user_id uuid NOT NULL REFERENCES users(id),
chat_id uuid NOT NULL REFERENCES chats(id) ON DELETE CASCADE,
key varchar(128) NOT NULL CHECK (key ~ '^[A-Za-z0-9._:-]{1,128}$'),
request_text text NOT NULL,
message_id uuid NOT NULL REFERENCES messages(id) ON DELETE CASCADE,
expires_at timestamptz NOT NULL,
PRIMARY KEY (user_id, chat_id, key)
);