1
CREATE TABLE t1 (id INT PRIMARY KEY);
2
CREATE TABLE `t2` LIKE `t1`;
3
ALTER TABLE `t2` ADD FOREIGN KEY (`id`) REFERENCES `t1`(`id`);
4
CREATE TABLE `t3` LIKE `t2`;
10
CONSTRAINT `t3_ibfk_1` FOREIGN KEY (`id`) REFERENCES `t1` (`id`)
11
) ENGINE=InnoDB COLLATE = utf8_general_ci
12
DROP TABLE t2, t3, t1;