forked from mtusi2026/mtusi2026lab4
Implement lab4 grade 3: private S3 attachments and persistence checks
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
-- Additive migration: old lab2 tables and rows are unchanged.
|
||||
-- This table is only for POST /chats/{chat_id}/messages; method/path scope is implicit.
|
||||
CREATE TABLE message_requests (
|
||||
actor_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}$'),
|
||||
fingerprint text NOT NULL,
|
||||
response jsonb NOT NULL,
|
||||
expires_at timestamptz NOT NULL,
|
||||
PRIMARY KEY (actor_id, chat_id, key)
|
||||
);
|
||||
CREATE INDEX message_requests_expiry ON message_requests(expires_at);
|
||||
Reference in New Issue
Block a user