taskcafe/migrations/0062_add-cascade-delete-to-task-comments-and-activity.up.sql

14 lines
421 B
MySQL
Raw Normal View History

ALTER TABLE task_activity DROP CONSTRAINT task_activity_task_id_fkey;
ALTER TABLE task_activity
ADD CONSTRAINT task_activity_task_id_fkey
FOREIGN KEY (task_id)
REFERENCES task(task_id)
ON DELETE CASCADE;
ALTER TABLE task_comment DROP CONSTRAINT task_comment_task_id_fkey;
ALTER TABLE task_comment
ADD CONSTRAINT task_comment_task_id_fkey
FOREIGN KEY (task_id)
REFERENCES task(task_id)
ON DELETE CASCADE;