12 lines
411 B
SQL
12 lines
411 B
SQL
CREATE TABLE message_requests (
|
|
user_id uuid NOT NULL REFERENCES users(id),
|
|
chat_id uuid NOT NULL REFERENCES chats(id),
|
|
request_key text NOT NULL,
|
|
request_hash bytea NOT NULL,
|
|
message_id uuid NOT NULL REFERENCES messages(id),
|
|
expires_at timestamptz NOT NULL,
|
|
PRIMARY KEY (user_id, chat_id, request_key)
|
|
);
|
|
|
|
CREATE INDEX message_requests_expires_idx ON message_requests (expires_at);
|