diff --git a/mysql/schema.sql b/mysql/schema.sql index 35e9beee..bb422a2e 100644 --- a/mysql/schema.sql +++ b/mysql/schema.sql @@ -55,5 +55,5 @@ CREATE TABLE likes CONSTRAINT posts_pk PRIMARY KEY (id), FOREIGN KEY (user_id) REFERENCES users (id), - FOREIGN KEY (post_id) REFERENCES posts (id) + FOREIGN KEY (post_id) REFERENCES posts (id) ON DELETE CASCADE );