Files
mtusi2026lab5/migrations/004_message_attachments.sql
T

6 lines
247 B
SQL

CREATE TABLE IF NOT EXISTS message_attachments (
message_id UUID NOT NULL REFERENCES messages(id) ON DELETE CASCADE,
attachment_id UUID NOT NULL REFERENCES attachments(id) ON DELETE RESTRICT,
PRIMARY KEY (message_id, attachment_id)
);