forked from mtusi2026/mtusi2026lab3
11 lines
410 B
SQL
11 lines
410 B
SQL
CREATE TABLE message_requests (
|
|
user_id uuid NOT NULL,
|
|
chat_id uuid NOT NULL,
|
|
request_key text NOT NULL,
|
|
fingerprint bytea NOT NULL,
|
|
expires_at timestamptz NOT NULL DEFAULT (clock_timestamp() + interval '24 hours'),
|
|
message_id uuid REFERENCES messages(id),
|
|
PRIMARY KEY (user_id, chat_id, request_key),
|
|
FOREIGN KEY (chat_id, user_id) REFERENCES chat_members(chat_id, user_id)
|
|
);
|