FrostByte/server/migrations/0005_engagements_table.sql

7 lines
270 B
MySQL
Raw Normal View History

2024-03-22 21:28:20 +01:00
CREATE TABLE IF NOT EXISTS engagements (
user_id BIGINT NOT NULL,
post_id BIGINT NOT NULL,
2024-03-22 23:38:08 +01:00
FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE,
FOREIGN KEY (post_id) REFERENCES posts (id) ON DELETE CASCADE,
2024-03-22 21:28:20 +01:00
PRIMARY KEY (user_id, post_id)
);