forked from mtusi2026/mtusi2026lab3
ЛР 3 — БВТ-2302 — Сабитов — на 3
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
CREATE TABLE message_requests (
|
||||
user_id uuid NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
||||
chat_id uuid NOT NULL REFERENCES chats(id) ON DELETE CASCADE,
|
||||
request_key varchar(128) NOT NULL,
|
||||
body_hash char(64) NOT NULL,
|
||||
message_id uuid NOT NULL REFERENCES messages(id) ON DELETE CASCADE,
|
||||
expires_at timestamptz NOT NULL,
|
||||
PRIMARY KEY (user_id, chat_id, request_key)
|
||||
);
|
||||
CREATE INDEX idx_message_requests_expiry ON message_requests(expires_at);
|
||||
Reference in New Issue
Block a user