11 lines
340 B
SQL
11 lines
340 B
SQL
CREATE TABLE message_requests (
|
|
user_id uuid NOT NULL REFERENCES users(id),
|
|
chat_id uuid NOT NULL REFERENCES chats(id),
|
|
key text NOT NULL,
|
|
body_hash bytea NOT NULL,
|
|
response jsonb NOT NULL,
|
|
expires_at timestamptz NOT NULL,
|
|
PRIMARY KEY(user_id,chat_id,key)
|
|
);
|
|
CREATE INDEX message_requests_expiry_idx ON message_requests(expires_at);
|