Files
mtusi2026lab7/migrations/003_idempotency.sql
T
R0flyan 2fa513f56c
Skeleton contracts / contracts (pull_request) Canceled after 0s
Lab7 HTTPS integration / compose (pull_request) Canceled after 0s
Реализовать защиту Lab7 и проверку отзыва worker
2026-11-27 21:53:26 +03:00

9 lines
304 B
SQL

CREATE TABLE message_keys (
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}$'),
message_id uuid NOT NULL REFERENCES messages(id),
expires_at timestamptz NOT NULL,
PRIMARY KEY (user_id, chat_id, key)
);