Files
mtusi2026lab3/migrations/002_idempotency.sql
T
2026-11-12 13:06:36 +03:00

10 lines
329 B
SQL

CREATE TABLE IF NOT EXISTS message_idempotency (
user_id uuid NOT NULL REFERENCES users(id),
chat_id uuid NOT NULL REFERENCES chats(id),
key varchar(128) NOT NULL,
fingerprint char(64) NOT NULL,
message_id uuid REFERENCES messages(id),
created_at timestamptz NOT NULL DEFAULT now(),
PRIMARY KEY (user_id, chat_id, key)
);