I found the error in chapter16 regarding deleting acronyms as below.
I tried to remove mysql image and add it again , then build vapor project .
Also checking the code by going through every concern files, but still get the error.
{“error”:true,“reason”:“Cannot delete or update a parent row: a foreign key constraint fails (vapor.acronym_category, CONSTRAINT acronym_category_ibfk_1 FOREIGN KEY (acronymID) REFERENCES acronyms (id))”}
@thammaporn it’s because you have a category relationship set up with that acronym. The new version of the book will show you how to remove that and it also shows you how to set up the DB to do a cascade delete to automatically remove the relationship. It’s in the online repo here vapor-til/AcronymCategoryPivot.swift at main · raywenderlich/vapor-til · GitHub