1CREATE TABLE child (
2 id INT,
3 parent_id INT,
4 INDEX par_ind (parent_id),
5 FOREIGN KEY (parent_id)
6 REFERENCES parent(id)
7 ON UPDATE CASCADE ON DELETE CASCADE
8 ) ENGINE=INNODB;
9
1CREATE TABLE child (
2 id INT,
3 parent_id INT,
4 INDEX par_ind (parent_id),
5 FOREIGN KEY (parent_id)
6 REFERENCES parent(id)
7 ON UPDATE CASCADE
8) ENGINE=INNODB;