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;