commit 90f811b51189432a9b8380815b29ddaddec1b04b parent 90edce05481e19a20c0f176024b4e32b5268407e Author: Andreas Gruhler <andreas.gruhler@adfinis.com> Date: Wed, 5 Apr 2023 00:08:36 +0200 feat: enable cascade delete for athletes Diffstat:
M | schema/ratings.sql | | | 2 | +- |
M | schema/startlist.sql | | | 2 | +- |
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/schema/ratings.sql b/schema/ratings.sql @@ -70,7 +70,7 @@ ALTER TABLE ONLY public.ratings -- ALTER TABLE ONLY public.ratings - ADD CONSTRAINT ratings_athlete_fkey FOREIGN KEY (athlete) REFERENCES public.athletes(id); + ADD CONSTRAINT ratings_athlete_fkey FOREIGN KEY (athlete) REFERENCES public.athletes(id) ON DELETE CASCADE; -- diff --git a/schema/startlist.sql b/schema/startlist.sql @@ -68,7 +68,7 @@ ALTER TABLE ONLY public.startlist -- ALTER TABLE ONLY public.startlist - ADD CONSTRAINT startlist_athlete_fkey FOREIGN KEY (athlete) REFERENCES public.athletes(id); + ADD CONSTRAINT startlist_athlete_fkey FOREIGN KEY (athlete) REFERENCES public.athletes(id) ON DELETE CASCADE; --