CREATE TABLE article ( id_article int unsigned not null auto_increment, title text not null, author int unsigned, publish_date datetime, publish_until datetime, teaser text, content text, url text not null, category int unsigned, tags text, template int unsigned not null, meta int unsigned, status enum('public','hidden','locked'), primary key (id_article) ) ENGINE = InnoDB; CREATE TABLE author ( id_author int unsigned not null auto_increment, title text not null, url text not null, template int unsigned not null, meta int unsigned, primary key (id_author) ) ENGINE = InnoDB; CREATE TABLE category ( id_category int unsigned not null auto_increment, title text not null, url text not null, template int unsigned not null, meta int unsigned, primary key (id_category) ) ENGINE = InnoDB; CREATE TABLE template ( id_template int unsigned not null auto_increment, title text not null, file text not null, primary key (id_template) ) ENGINE = InnoDB; CREATE TABLE meta ( id_meta int unsigned not null auto_increment, description text, noindex tinyint(1), nofollow tinyint(1), primary key (id_meta) ) ENGINE = InnoDB; ALTER TABLE article add foreign key (author) references author(id_author), add foreign key (category) references category(id_category), add foreign key (template) references template(id_template), add foreign key (meta) references meta(id_meta) ; ALTER TABLE author add foreign key (template) references template(id_template), add foreign key (meta) references meta(id_meta) ; ALTER TABLE category add foreign key (template) references template(id_template), add foreign key (meta) references meta(id_meta) ;