drop schema if exists performanceTest2; create schema performanceTest2; use performanceTest2; drop table if exists t1; create table t1 ( id int unsigned not null auto_increment, primary key(id), content text ) engine=innodb; drop table if exists t2; create table t2 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, content text ) engine=innodb; alter table t2 add foreign key (t1Id) references t1 (id); drop table if exists t3; create table t3 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, content text ) engine=innodb; alter table t3 add foreign key (t1Id) references t1 (id); alter table t3 add foreign key (t2Id) references t2 (id); drop table if exists t4; create table t4 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, content text ) engine=innodb; alter table t4 add foreign key (t1Id) references t1 (id); alter table t4 add foreign key (t2Id) references t2 (id); alter table t4 add foreign key (t3Id) references t3 (id); drop table if exists t5; create table t5 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, t4Id int unsigned not null, content text ) engine=innodb; alter table t5 add foreign key (t1Id) references t1 (id); alter table t5 add foreign key (t2Id) references t2 (id); alter table t5 add foreign key (t3Id) references t3 (id); alter table t5 add foreign key (t4Id) references t4 (id); drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t1; create table t1 ( id int unsigned not null auto_increment, primary key(id), content text ) engine=innodb; drop table if exists t2; create table t2 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, content text ) engine=innodb; alter table t2 add foreign key (t1Id) references t1 (id); drop table if exists t3; create table t3 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, content text ) engine=innodb; alter table t3 add foreign key (t1Id) references t1 (id); alter table t3 add foreign key (t2Id) references t2 (id); drop table if exists t4; create table t4 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, content text ) engine=innodb; alter table t4 add foreign key (t1Id) references t1 (id); alter table t4 add foreign key (t2Id) references t2 (id); alter table t4 add foreign key (t3Id) references t3 (id); drop table if exists t5; create table t5 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, t4Id int unsigned not null, content text ) engine=innodb; alter table t5 add foreign key (t1Id) references t1 (id); alter table t5 add foreign key (t2Id) references t2 (id); alter table t5 add foreign key (t3Id) references t3 (id); alter table t5 add foreign key (t4Id) references t4 (id); drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t1; create table t1 ( id int unsigned not null auto_increment, primary key(id), content text ) engine=innodb; drop table if exists t2; create table t2 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, content text ) engine=innodb; alter table t2 add foreign key (t1Id) references t1 (id); drop table if exists t3; create table t3 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, content text ) engine=innodb; alter table t3 add foreign key (t1Id) references t1 (id); alter table t3 add foreign key (t2Id) references t2 (id); drop table if exists t4; create table t4 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, content text ) engine=innodb; alter table t4 add foreign key (t1Id) references t1 (id); alter table t4 add foreign key (t2Id) references t2 (id); alter table t4 add foreign key (t3Id) references t3 (id); drop table if exists t5; create table t5 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, t4Id int unsigned not null, content text ) engine=innodb; alter table t5 add foreign key (t1Id) references t1 (id); alter table t5 add foreign key (t2Id) references t2 (id); alter table t5 add foreign key (t3Id) references t3 (id); alter table t5 add foreign key (t4Id) references t4 (id); drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t1; create table t1 ( id int unsigned not null auto_increment, primary key(id), content text ) engine=innodb; drop table if exists t2; create table t2 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, content text ) engine=innodb; alter table t2 add foreign key (t1Id) references t1 (id); drop table if exists t3; create table t3 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, content text ) engine=innodb; alter table t3 add foreign key (t1Id) references t1 (id); alter table t3 add foreign key (t2Id) references t2 (id); drop table if exists t4; create table t4 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, content text ) engine=innodb; alter table t4 add foreign key (t1Id) references t1 (id); alter table t4 add foreign key (t2Id) references t2 (id); alter table t4 add foreign key (t3Id) references t3 (id); drop table if exists t5; create table t5 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, t4Id int unsigned not null, content text ) engine=innodb; alter table t5 add foreign key (t1Id) references t1 (id); alter table t5 add foreign key (t2Id) references t2 (id); alter table t5 add foreign key (t3Id) references t3 (id); alter table t5 add foreign key (t4Id) references t4 (id); drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t1; create table t1 ( id int unsigned not null auto_increment, primary key(id), content text ) engine=innodb; drop table if exists t2; create table t2 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, content text ) engine=innodb; alter table t2 add foreign key (t1Id) references t1 (id); drop table if exists t3; create table t3 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, content text ) engine=innodb; alter table t3 add foreign key (t1Id) references t1 (id); alter table t3 add foreign key (t2Id) references t2 (id); drop table if exists t4; create table t4 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, content text ) engine=innodb; alter table t4 add foreign key (t1Id) references t1 (id); alter table t4 add foreign key (t2Id) references t2 (id); alter table t4 add foreign key (t3Id) references t3 (id); drop table if exists t5; create table t5 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, t4Id int unsigned not null, content text ) engine=innodb; alter table t5 add foreign key (t1Id) references t1 (id); alter table t5 add foreign key (t2Id) references t2 (id); alter table t5 add foreign key (t3Id) references t3 (id); alter table t5 add foreign key (t4Id) references t4 (id); drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t1; create table t1 ( id int unsigned not null auto_increment, primary key(id), content text ) engine=innodb; drop table if exists t2; create table t2 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, content text ) engine=innodb; alter table t2 add foreign key (t1Id) references t1 (id); drop table if exists t3; create table t3 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, content text ) engine=innodb; alter table t3 add foreign key (t1Id) references t1 (id); alter table t3 add foreign key (t2Id) references t2 (id); drop table if exists t4; create table t4 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, content text ) engine=innodb; alter table t4 add foreign key (t1Id) references t1 (id); alter table t4 add foreign key (t2Id) references t2 (id); alter table t4 add foreign key (t3Id) references t3 (id); drop table if exists t5; create table t5 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, t4Id int unsigned not null, content text ) engine=innodb; alter table t5 add foreign key (t1Id) references t1 (id); alter table t5 add foreign key (t2Id) references t2 (id); alter table t5 add foreign key (t3Id) references t3 (id); alter table t5 add foreign key (t4Id) references t4 (id); drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t1; create table t1 ( id int unsigned not null auto_increment, primary key(id), content text ) engine=innodb; drop table if exists t2; create table t2 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, content text ) engine=innodb; alter table t2 add foreign key (t1Id) references t1 (id); drop table if exists t3; create table t3 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, content text ) engine=innodb; alter table t3 add foreign key (t1Id) references t1 (id); alter table t3 add foreign key (t2Id) references t2 (id); drop table if exists t4; create table t4 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, content text ) engine=innodb; alter table t4 add foreign key (t1Id) references t1 (id); alter table t4 add foreign key (t2Id) references t2 (id); alter table t4 add foreign key (t3Id) references t3 (id); drop table if exists t5; create table t5 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, t4Id int unsigned not null, content text ) engine=innodb; alter table t5 add foreign key (t1Id) references t1 (id); alter table t5 add foreign key (t2Id) references t2 (id); alter table t5 add foreign key (t3Id) references t3 (id); alter table t5 add foreign key (t4Id) references t4 (id); drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t1; create table t1 ( id int unsigned not null auto_increment, primary key(id), content text ) engine=innodb; drop table if exists t2; create table t2 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, content text ) engine=innodb; alter table t2 add foreign key (t1Id) references t1 (id); drop table if exists t3; create table t3 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, content text ) engine=innodb; alter table t3 add foreign key (t1Id) references t1 (id); alter table t3 add foreign key (t2Id) references t2 (id); drop table if exists t4; create table t4 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, content text ) engine=innodb; alter table t4 add foreign key (t1Id) references t1 (id); alter table t4 add foreign key (t2Id) references t2 (id); alter table t4 add foreign key (t3Id) references t3 (id); drop table if exists t5; create table t5 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, t4Id int unsigned not null, content text ) engine=innodb; alter table t5 add foreign key (t1Id) references t1 (id); alter table t5 add foreign key (t2Id) references t2 (id); alter table t5 add foreign key (t3Id) references t3 (id); alter table t5 add foreign key (t4Id) references t4 (id); drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t1; create table t1 ( id int unsigned not null auto_increment, primary key(id), content text ) engine=innodb; drop table if exists t2; create table t2 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, content text ) engine=innodb; alter table t2 add foreign key (t1Id) references t1 (id); drop table if exists t3; create table t3 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, content text ) engine=innodb; alter table t3 add foreign key (t1Id) references t1 (id); alter table t3 add foreign key (t2Id) references t2 (id); drop table if exists t4; create table t4 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, content text ) engine=innodb; alter table t4 add foreign key (t1Id) references t1 (id); alter table t4 add foreign key (t2Id) references t2 (id); alter table t4 add foreign key (t3Id) references t3 (id); drop table if exists t5; create table t5 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, t4Id int unsigned not null, content text ) engine=innodb; alter table t5 add foreign key (t1Id) references t1 (id); alter table t5 add foreign key (t2Id) references t2 (id); alter table t5 add foreign key (t3Id) references t3 (id); alter table t5 add foreign key (t4Id) references t4 (id); drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t1; create table t1 ( id int unsigned not null auto_increment, primary key(id), content text ) engine=innodb; drop table if exists t2; create table t2 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, content text ) engine=innodb; alter table t2 add foreign key (t1Id) references t1 (id); drop table if exists t3; create table t3 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, content text ) engine=innodb; alter table t3 add foreign key (t1Id) references t1 (id); alter table t3 add foreign key (t2Id) references t2 (id); drop table if exists t4; create table t4 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, content text ) engine=innodb; alter table t4 add foreign key (t1Id) references t1 (id); alter table t4 add foreign key (t2Id) references t2 (id); alter table t4 add foreign key (t3Id) references t3 (id); drop table if exists t5; create table t5 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, t4Id int unsigned not null, content text ) engine=innodb; alter table t5 add foreign key (t1Id) references t1 (id); alter table t5 add foreign key (t2Id) references t2 (id); alter table t5 add foreign key (t3Id) references t3 (id); alter table t5 add foreign key (t4Id) references t4 (id); drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t1; create table t1 ( id int unsigned not null auto_increment, primary key(id), content text ) engine=innodb; drop table if exists t2; create table t2 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, content text ) engine=innodb; alter table t2 add foreign key (t1Id) references t1 (id); drop table if exists t3; create table t3 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, content text ) engine=innodb; alter table t3 add foreign key (t1Id) references t1 (id); alter table t3 add foreign key (t2Id) references t2 (id); drop table if exists t4; create table t4 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, content text ) engine=innodb; alter table t4 add foreign key (t1Id) references t1 (id); alter table t4 add foreign key (t2Id) references t2 (id); alter table t4 add foreign key (t3Id) references t3 (id); drop table if exists t5; create table t5 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, t4Id int unsigned not null, content text ) engine=innodb; alter table t5 add foreign key (t1Id) references t1 (id); alter table t5 add foreign key (t2Id) references t2 (id); alter table t5 add foreign key (t3Id) references t3 (id); alter table t5 add foreign key (t4Id) references t4 (id); drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t1; create table t1 ( id int unsigned not null auto_increment, primary key(id), content text ) engine=innodb; drop table if exists t2; create table t2 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, content text ) engine=innodb; alter table t2 add foreign key (t1Id) references t1 (id); drop table if exists t3; create table t3 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, content text ) engine=innodb; alter table t3 add foreign key (t1Id) references t1 (id); alter table t3 add foreign key (t2Id) references t2 (id); drop table if exists t4; create table t4 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, content text ) engine=innodb; alter table t4 add foreign key (t1Id) references t1 (id); alter table t4 add foreign key (t2Id) references t2 (id); alter table t4 add foreign key (t3Id) references t3 (id); drop table if exists t5; create table t5 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, t4Id int unsigned not null, content text ) engine=innodb; alter table t5 add foreign key (t1Id) references t1 (id); alter table t5 add foreign key (t2Id) references t2 (id); alter table t5 add foreign key (t3Id) references t3 (id); alter table t5 add foreign key (t4Id) references t4 (id); drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t1; create table t1 ( id int unsigned not null auto_increment, primary key(id), content text ) engine=innodb; drop table if exists t2; create table t2 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, content text ) engine=innodb; alter table t2 add foreign key (t1Id) references t1 (id); drop table if exists t3; create table t3 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, content text ) engine=innodb; alter table t3 add foreign key (t1Id) references t1 (id); alter table t3 add foreign key (t2Id) references t2 (id); drop table if exists t4; create table t4 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, content text ) engine=innodb; alter table t4 add foreign key (t1Id) references t1 (id); alter table t4 add foreign key (t2Id) references t2 (id); alter table t4 add foreign key (t3Id) references t3 (id); drop table if exists t5; create table t5 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, t4Id int unsigned not null, content text ) engine=innodb; alter table t5 add foreign key (t1Id) references t1 (id); alter table t5 add foreign key (t2Id) references t2 (id); alter table t5 add foreign key (t3Id) references t3 (id); alter table t5 add foreign key (t4Id) references t4 (id); drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t1; create table t1 ( id int unsigned not null auto_increment, primary key(id), content text ) engine=innodb; drop table if exists t2; create table t2 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, content text ) engine=innodb; alter table t2 add foreign key (t1Id) references t1 (id); drop table if exists t3; create table t3 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, content text ) engine=innodb; alter table t3 add foreign key (t1Id) references t1 (id); alter table t3 add foreign key (t2Id) references t2 (id); drop table if exists t4; create table t4 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, content text ) engine=innodb; alter table t4 add foreign key (t1Id) references t1 (id); alter table t4 add foreign key (t2Id) references t2 (id); alter table t4 add foreign key (t3Id) references t3 (id); drop table if exists t5; create table t5 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, t4Id int unsigned not null, content text ) engine=innodb; alter table t5 add foreign key (t1Id) references t1 (id); alter table t5 add foreign key (t2Id) references t2 (id); alter table t5 add foreign key (t3Id) references t3 (id); alter table t5 add foreign key (t4Id) references t4 (id); drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t1; create table t1 ( id int unsigned not null auto_increment, primary key(id), content text ) engine=innodb; drop table if exists t2; create table t2 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, content text ) engine=innodb; alter table t2 add foreign key (t1Id) references t1 (id); drop table if exists t3; create table t3 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, content text ) engine=innodb; alter table t3 add foreign key (t1Id) references t1 (id); alter table t3 add foreign key (t2Id) references t2 (id); drop table if exists t4; create table t4 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, content text ) engine=innodb; alter table t4 add foreign key (t1Id) references t1 (id); alter table t4 add foreign key (t2Id) references t2 (id); alter table t4 add foreign key (t3Id) references t3 (id); drop table if exists t5; create table t5 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, t4Id int unsigned not null, content text ) engine=innodb; alter table t5 add foreign key (t1Id) references t1 (id); alter table t5 add foreign key (t2Id) references t2 (id); alter table t5 add foreign key (t3Id) references t3 (id); alter table t5 add foreign key (t4Id) references t4 (id); drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t1; create table t1 ( id int unsigned not null auto_increment, primary key(id), content text ) engine=innodb; drop table if exists t2; create table t2 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, content text ) engine=innodb; alter table t2 add foreign key (t1Id) references t1 (id); drop table if exists t3; create table t3 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, content text ) engine=innodb; alter table t3 add foreign key (t1Id) references t1 (id); alter table t3 add foreign key (t2Id) references t2 (id); drop table if exists t4; create table t4 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, content text ) engine=innodb; alter table t4 add foreign key (t1Id) references t1 (id); alter table t4 add foreign key (t2Id) references t2 (id); alter table t4 add foreign key (t3Id) references t3 (id); drop table if exists t5; create table t5 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, t4Id int unsigned not null, content text ) engine=innodb; alter table t5 add foreign key (t1Id) references t1 (id); alter table t5 add foreign key (t2Id) references t2 (id); alter table t5 add foreign key (t3Id) references t3 (id); alter table t5 add foreign key (t4Id) references t4 (id); drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t1; create table t1 ( id int unsigned not null auto_increment, primary key(id), content text ) engine=innodb; drop table if exists t2; create table t2 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, content text ) engine=innodb; alter table t2 add foreign key (t1Id) references t1 (id); drop table if exists t3; create table t3 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, content text ) engine=innodb; alter table t3 add foreign key (t1Id) references t1 (id); alter table t3 add foreign key (t2Id) references t2 (id); drop table if exists t4; create table t4 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, content text ) engine=innodb; alter table t4 add foreign key (t1Id) references t1 (id); alter table t4 add foreign key (t2Id) references t2 (id); alter table t4 add foreign key (t3Id) references t3 (id); drop table if exists t5; create table t5 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, t4Id int unsigned not null, content text ) engine=innodb; alter table t5 add foreign key (t1Id) references t1 (id); alter table t5 add foreign key (t2Id) references t2 (id); alter table t5 add foreign key (t3Id) references t3 (id); alter table t5 add foreign key (t4Id) references t4 (id); drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t1; create table t1 ( id int unsigned not null auto_increment, primary key(id), content text ) engine=innodb; drop table if exists t2; create table t2 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, content text ) engine=innodb; alter table t2 add foreign key (t1Id) references t1 (id); drop table if exists t3; create table t3 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, content text ) engine=innodb; alter table t3 add foreign key (t1Id) references t1 (id); alter table t3 add foreign key (t2Id) references t2 (id); drop table if exists t4; create table t4 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, content text ) engine=innodb; alter table t4 add foreign key (t1Id) references t1 (id); alter table t4 add foreign key (t2Id) references t2 (id); alter table t4 add foreign key (t3Id) references t3 (id); drop table if exists t5; create table t5 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, t4Id int unsigned not null, content text ) engine=innodb; alter table t5 add foreign key (t1Id) references t1 (id); alter table t5 add foreign key (t2Id) references t2 (id); alter table t5 add foreign key (t3Id) references t3 (id); alter table t5 add foreign key (t4Id) references t4 (id); drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t1; create table t1 ( id int unsigned not null auto_increment, primary key(id), content text ) engine=innodb; drop table if exists t2; create table t2 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, content text ) engine=innodb; alter table t2 add foreign key (t1Id) references t1 (id); drop table if exists t3; create table t3 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, content text ) engine=innodb; alter table t3 add foreign key (t1Id) references t1 (id); alter table t3 add foreign key (t2Id) references t2 (id); drop table if exists t4; create table t4 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, content text ) engine=innodb; alter table t4 add foreign key (t1Id) references t1 (id); alter table t4 add foreign key (t2Id) references t2 (id); alter table t4 add foreign key (t3Id) references t3 (id); drop table if exists t5; create table t5 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, t4Id int unsigned not null, content text ) engine=innodb; alter table t5 add foreign key (t1Id) references t1 (id); alter table t5 add foreign key (t2Id) references t2 (id); alter table t5 add foreign key (t3Id) references t3 (id); alter table t5 add foreign key (t4Id) references t4 (id); drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t1; create table t1 ( id int unsigned not null auto_increment, primary key(id), content text ) engine=innodb; drop table if exists t2; create table t2 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, content text ) engine=innodb; alter table t2 add foreign key (t1Id) references t1 (id); drop table if exists t3; create table t3 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, content text ) engine=innodb; alter table t3 add foreign key (t1Id) references t1 (id); alter table t3 add foreign key (t2Id) references t2 (id); drop table if exists t4; create table t4 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, content text ) engine=innodb; alter table t4 add foreign key (t1Id) references t1 (id); alter table t4 add foreign key (t2Id) references t2 (id); alter table t4 add foreign key (t3Id) references t3 (id); drop table if exists t5; create table t5 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, t4Id int unsigned not null, content text ) engine=innodb; alter table t5 add foreign key (t1Id) references t1 (id); alter table t5 add foreign key (t2Id) references t2 (id); alter table t5 add foreign key (t3Id) references t3 (id); alter table t5 add foreign key (t4Id) references t4 (id); drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t1; create table t1 ( id int unsigned not null auto_increment, primary key(id), content text ) engine=innodb; drop table if exists t2; create table t2 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, content text ) engine=innodb; alter table t2 add foreign key (t1Id) references t1 (id); drop table if exists t3; create table t3 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, content text ) engine=innodb; alter table t3 add foreign key (t1Id) references t1 (id); alter table t3 add foreign key (t2Id) references t2 (id); drop table if exists t4; create table t4 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, content text ) engine=innodb; alter table t4 add foreign key (t1Id) references t1 (id); alter table t4 add foreign key (t2Id) references t2 (id); alter table t4 add foreign key (t3Id) references t3 (id); drop table if exists t5; create table t5 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, t4Id int unsigned not null, content text ) engine=innodb; alter table t5 add foreign key (t1Id) references t1 (id); alter table t5 add foreign key (t2Id) references t2 (id); alter table t5 add foreign key (t3Id) references t3 (id); alter table t5 add foreign key (t4Id) references t4 (id); drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t1; create table t1 ( id int unsigned not null auto_increment, primary key(id), content text ) engine=innodb; drop table if exists t2; create table t2 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, content text ) engine=innodb; alter table t2 add foreign key (t1Id) references t1 (id); drop table if exists t3; create table t3 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, content text ) engine=innodb; alter table t3 add foreign key (t1Id) references t1 (id); alter table t3 add foreign key (t2Id) references t2 (id); drop table if exists t4; create table t4 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, content text ) engine=innodb; alter table t4 add foreign key (t1Id) references t1 (id); alter table t4 add foreign key (t2Id) references t2 (id); alter table t4 add foreign key (t3Id) references t3 (id); drop table if exists t5; create table t5 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, t4Id int unsigned not null, content text ) engine=innodb; alter table t5 add foreign key (t1Id) references t1 (id); alter table t5 add foreign key (t2Id) references t2 (id); alter table t5 add foreign key (t3Id) references t3 (id); alter table t5 add foreign key (t4Id) references t4 (id); drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t1; create table t1 ( id int unsigned not null auto_increment, primary key(id), content text ) engine=innodb; drop table if exists t2; create table t2 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, content text ) engine=innodb; alter table t2 add foreign key (t1Id) references t1 (id); drop table if exists t3; create table t3 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, content text ) engine=innodb; alter table t3 add foreign key (t1Id) references t1 (id); alter table t3 add foreign key (t2Id) references t2 (id); drop table if exists t4; create table t4 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, content text ) engine=innodb; alter table t4 add foreign key (t1Id) references t1 (id); alter table t4 add foreign key (t2Id) references t2 (id); alter table t4 add foreign key (t3Id) references t3 (id); drop table if exists t5; create table t5 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, t4Id int unsigned not null, content text ) engine=innodb; alter table t5 add foreign key (t1Id) references t1 (id); alter table t5 add foreign key (t2Id) references t2 (id); alter table t5 add foreign key (t3Id) references t3 (id); alter table t5 add foreign key (t4Id) references t4 (id); drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t1; create table t1 ( id int unsigned not null auto_increment, primary key(id), content text ) engine=innodb; drop table if exists t2; create table t2 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, content text ) engine=innodb; alter table t2 add foreign key (t1Id) references t1 (id); drop table if exists t3; create table t3 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, content text ) engine=innodb; alter table t3 add foreign key (t1Id) references t1 (id); alter table t3 add foreign key (t2Id) references t2 (id); drop table if exists t4; create table t4 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, content text ) engine=innodb; alter table t4 add foreign key (t1Id) references t1 (id); alter table t4 add foreign key (t2Id) references t2 (id); alter table t4 add foreign key (t3Id) references t3 (id); drop table if exists t5; create table t5 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, t4Id int unsigned not null, content text ) engine=innodb; alter table t5 add foreign key (t1Id) references t1 (id); alter table t5 add foreign key (t2Id) references t2 (id); alter table t5 add foreign key (t3Id) references t3 (id); alter table t5 add foreign key (t4Id) references t4 (id); drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t1; create table t1 ( id int unsigned not null auto_increment, primary key(id), content text ) engine=innodb; drop table if exists t2; create table t2 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, content text ) engine=innodb; alter table t2 add foreign key (t1Id) references t1 (id); drop table if exists t3; create table t3 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, content text ) engine=innodb; alter table t3 add foreign key (t1Id) references t1 (id); alter table t3 add foreign key (t2Id) references t2 (id); drop table if exists t4; create table t4 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, content text ) engine=innodb; alter table t4 add foreign key (t1Id) references t1 (id); alter table t4 add foreign key (t2Id) references t2 (id); alter table t4 add foreign key (t3Id) references t3 (id); drop table if exists t5; create table t5 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, t4Id int unsigned not null, content text ) engine=innodb; alter table t5 add foreign key (t1Id) references t1 (id); alter table t5 add foreign key (t2Id) references t2 (id); alter table t5 add foreign key (t3Id) references t3 (id); alter table t5 add foreign key (t4Id) references t4 (id); drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t1; create table t1 ( id int unsigned not null auto_increment, primary key(id), content text ) engine=innodb; drop table if exists t2; create table t2 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, content text ) engine=innodb; alter table t2 add foreign key (t1Id) references t1 (id); drop table if exists t3; create table t3 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, content text ) engine=innodb; alter table t3 add foreign key (t1Id) references t1 (id); alter table t3 add foreign key (t2Id) references t2 (id); drop table if exists t4; create table t4 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, content text ) engine=innodb; alter table t4 add foreign key (t1Id) references t1 (id); alter table t4 add foreign key (t2Id) references t2 (id); alter table t4 add foreign key (t3Id) references t3 (id); drop table if exists t5; create table t5 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, t4Id int unsigned not null, content text ) engine=innodb; alter table t5 add foreign key (t1Id) references t1 (id); alter table t5 add foreign key (t2Id) references t2 (id); alter table t5 add foreign key (t3Id) references t3 (id); alter table t5 add foreign key (t4Id) references t4 (id); drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t1; create table t1 ( id int unsigned not null auto_increment, primary key(id), content text ) engine=innodb; drop table if exists t2; create table t2 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, content text ) engine=innodb; alter table t2 add foreign key (t1Id) references t1 (id); drop table if exists t3; create table t3 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, content text ) engine=innodb; alter table t3 add foreign key (t1Id) references t1 (id); alter table t3 add foreign key (t2Id) references t2 (id); drop table if exists t4; create table t4 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, content text ) engine=innodb; alter table t4 add foreign key (t1Id) references t1 (id); alter table t4 add foreign key (t2Id) references t2 (id); alter table t4 add foreign key (t3Id) references t3 (id); drop table if exists t5; create table t5 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, t4Id int unsigned not null, content text ) engine=innodb; alter table t5 add foreign key (t1Id) references t1 (id); alter table t5 add foreign key (t2Id) references t2 (id); alter table t5 add foreign key (t3Id) references t3 (id); alter table t5 add foreign key (t4Id) references t4 (id); drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t1; create table t1 ( id int unsigned not null auto_increment, primary key(id), content text ) engine=innodb; drop table if exists t2; create table t2 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, content text ) engine=innodb; alter table t2 add foreign key (t1Id) references t1 (id); drop table if exists t3; create table t3 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, content text ) engine=innodb; alter table t3 add foreign key (t1Id) references t1 (id); alter table t3 add foreign key (t2Id) references t2 (id); drop table if exists t4; create table t4 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, content text ) engine=innodb; alter table t4 add foreign key (t1Id) references t1 (id); alter table t4 add foreign key (t2Id) references t2 (id); alter table t4 add foreign key (t3Id) references t3 (id); drop table if exists t5; create table t5 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, t4Id int unsigned not null, content text ) engine=innodb; alter table t5 add foreign key (t1Id) references t1 (id); alter table t5 add foreign key (t2Id) references t2 (id); alter table t5 add foreign key (t3Id) references t3 (id); alter table t5 add foreign key (t4Id) references t4 (id); drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t1; create table t1 ( id int unsigned not null auto_increment, primary key(id), content text ) engine=innodb; drop table if exists t2; create table t2 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, content text ) engine=innodb; alter table t2 add foreign key (t1Id) references t1 (id); drop table if exists t3; create table t3 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, content text ) engine=innodb; alter table t3 add foreign key (t1Id) references t1 (id); alter table t3 add foreign key (t2Id) references t2 (id); drop table if exists t4; create table t4 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, content text ) engine=innodb; alter table t4 add foreign key (t1Id) references t1 (id); alter table t4 add foreign key (t2Id) references t2 (id); alter table t4 add foreign key (t3Id) references t3 (id); drop table if exists t5; create table t5 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, t4Id int unsigned not null, content text ) engine=innodb; alter table t5 add foreign key (t1Id) references t1 (id); alter table t5 add foreign key (t2Id) references t2 (id); alter table t5 add foreign key (t3Id) references t3 (id); alter table t5 add foreign key (t4Id) references t4 (id); drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t1; create table t1 ( id int unsigned not null auto_increment, primary key(id), content text ) engine=innodb; drop table if exists t2; create table t2 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, content text ) engine=innodb; alter table t2 add foreign key (t1Id) references t1 (id); drop table if exists t3; create table t3 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, content text ) engine=innodb; alter table t3 add foreign key (t1Id) references t1 (id); alter table t3 add foreign key (t2Id) references t2 (id); drop table if exists t4; create table t4 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, content text ) engine=innodb; alter table t4 add foreign key (t1Id) references t1 (id); alter table t4 add foreign key (t2Id) references t2 (id); alter table t4 add foreign key (t3Id) references t3 (id); drop table if exists t5; create table t5 ( id int unsigned not null auto_increment, primary key(id), t1Id int unsigned not null, t2Id int unsigned not null, t3Id int unsigned not null, t4Id int unsigned not null, content text ) engine=innodb; alter table t5 add foreign key (t1Id) references t1 (id); alter table t5 add foreign key (t2Id) references t2 (id); alter table t5 add foreign key (t3Id) references t3 (id); alter table t5 add foreign key (t4Id) references t4 (id); drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ; drop table if exists t5 ; drop table if exists t4 ; drop table if exists t3 ; drop table if exists t2 ; drop table if exists t1 ;