MySQL foreign key constraints, cascade delete
If your cascading deletes nuke a product because it was a member of a category that was killed, then you’ve set up your foreign keys improperly. Given your example tables, you should have the following table setup: CREATE TABLE categories ( id int unsigned not null primary key, name VARCHAR(255) default null )Engine=InnoDB; CREATE TABLE … Read more