forked from mtusi2026/mtusi2026lab3
Prepare verified laboratory 3 implementation and evidence
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
-- +goose Up
|
||||
CREATE TABLE idempotency (
|
||||
user_id uuid NOT NULL REFERENCES users(id),
|
||||
chat_id uuid NOT NULL REFERENCES chats(id),
|
||||
key text NOT NULL CHECK (key ~ '^[A-Za-z0-9._:-]{1,128}$'),
|
||||
payload_hash text NOT NULL CHECK (length(payload_hash)=64),
|
||||
message_id uuid NOT NULL REFERENCES messages(id) DEFERRABLE INITIALLY DEFERRED,
|
||||
expires_at timestamptz NOT NULL,
|
||||
PRIMARY KEY(user_id,chat_id,key)
|
||||
);
|
||||
-- +goose Down
|
||||
DROP TABLE idempotency;
|
||||
Reference in New Issue
Block a user