Archives by date

You are browsing the site archives by date.

Add on delete cascade to foreign key mysql

Here’s a quick process for adding ON DELETE CASCADE to your foreign key constraints in mySQL. You will need to drop the foreign key constraint and re-institute it. use SHOW CREATE TABLE [table_name];, where table_name is your table identify the name of the foreign key(s). They usually end with _ibfk_ plus a number Drop the […]