forked from mtusi2026/mtusi2026lab5
Add 4 lab code
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
-- Additive migration: no rewrite of existing lab2 tables or messages.
|
||||
CREATE TABLE message_idempotency (
|
||||
actor_id uuid NOT NULL REFERENCES users(id),
|
||||
chat_id uuid NOT NULL REFERENCES chats(id) ON DELETE CASCADE,
|
||||
key text NOT NULL CHECK (key ~ '^[A-Za-z0-9._:-]{1,128}$'),
|
||||
message_id uuid NOT NULL REFERENCES messages(id) ON DELETE CASCADE,
|
||||
created_at timestamptz NOT NULL DEFAULT clock_timestamp(),
|
||||
PRIMARY KEY (actor_id, chat_id, key)
|
||||
);
|
||||
Reference in New Issue
Block a user