mysql foreign key constraints -


I have defined foreign key integrity in the table but I am able to delete data from the master table, which is in the child table. The reference is .. What would be the problem really, it should be an error on removal, as all the referenced table data will be removed.

When did you make your own FK? It is not known which engine you are using

example

  create table origin (id INT not zero, primary key) engine = INNODB ; Create a table child (ID INT, parent_id INT, index par_ind (parent_id), foreign key (parent_id) reference DELETE CASCADE parent (id) ENGINE = INNODB;  

and here


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -