6 lines
247 B
SQL
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)
|
|
);
|