create table article(
id int not null auto_increment primary key,
title varchar(50) not null,
content longtext not null,
author varchar(20) not null,
datetime datetime,
typeId int not null,
foreign key (typeId) references type(id),
foreign key (author) references users(name)
);
create table type(
id int not null auto_increment primary key,
name varchar(50) not null,
author varchar(20) not null,
foreign key (author) references users(name)
);
create table post(
id int not null auto_increment primary key,
content varchar(4000) not null,
datetime datetime,
author varchar(20) not null,
foreign key (author) references users(name),
articleId int not null,
foreign key (articleId) references article(id)
);