From 70e76f964150afee9eeae4048996f41df3349b1b Mon Sep 17 00:00:00 2001 From: Hubert Van De Walle Date: Sat, 25 Apr 2020 18:44:38 +0200 Subject: [PATCH] Fix cascade --- api/resources/db/migration/V8__Notes_uuid.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/resources/db/migration/V8__Notes_uuid.sql b/api/resources/db/migration/V8__Notes_uuid.sql index f944b38..301e6f4 100644 --- a/api/resources/db/migration/V8__Notes_uuid.sql +++ b/api/resources/db/migration/V8__Notes_uuid.sql @@ -22,7 +22,7 @@ CREATE TABLE `Tags` ); ALTER TABLE `Tags` - ADD FOREIGN KEY (`note_uuid`) REFERENCES `Notes` (`uuid`) ON DELETE RESTRICT ON UPDATE RESTRICT; + ADD FOREIGN KEY (`note_uuid`) REFERENCES `Notes` (`uuid`) ON DELETE CASCADE ON UPDATE RESTRICT; CREATE TABLE `Chapters` ( @@ -34,4 +34,4 @@ CREATE TABLE `Chapters` ); ALTER TABLE `Chapters` - ADD FOREIGN KEY (`note_uuid`) REFERENCES `Notes` (`uuid`) ON DELETE RESTRICT ON UPDATE RESTRICT; + ADD FOREIGN KEY (`note_uuid`) REFERENCES `Notes` (`uuid`) ON DELETE CASCADE ON UPDATE RESTRICT;