Files
mtusi2026lab3/db/migrations/002_idempotency.sql
T

10 lines
326 B
SQL

CREATE TABLE message_requests (
chat_id UUID NOT NULL REFERENCES chats(id),
sender_id UUID NOT NULL REFERENCES users(id),
key VARCHAR(128) NOT NULL,
text TEXT NOT NULL,
message_id UUID REFERENCES messages(id),
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
PRIMARY KEY (chat_id, sender_id, key)
);