1
Fork 0
shimmeringmoon/migrations/04-auto-delete-scores/up.sql

8 lines
193 B
MySQL
Raw Normal View History

-- Automatically delete all associated scores
-- every time a play is deleted.
CREATE TRIGGER auto_delete_scores AFTER DELETE ON plays
BEGIN
DELETE FROM scores
WHERE play_id = OLD.id;
END;