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
Post a Comment