|
|
@ -1,4 +1,5 @@
|
|
|
|
-- Blog posts
|
|
|
|
-- Blog posts
|
|
|
|
|
|
|
|
drop table if exists posts;
|
|
|
|
create table posts (
|
|
|
|
create table posts (
|
|
|
|
id serial,
|
|
|
|
id serial,
|
|
|
|
title varchar(128) not null,
|
|
|
|
title varchar(128) not null,
|
|
|
@ -10,13 +11,15 @@ create table posts (
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
-- Blog comments
|
|
|
|
-- Blog comments
|
|
|
|
|
|
|
|
drop table if exists comments;
|
|
|
|
create table comments (
|
|
|
|
create table comments (
|
|
|
|
id serial,
|
|
|
|
id serial,
|
|
|
|
sender varchar(64) not null,
|
|
|
|
sender varchar(64) not null,
|
|
|
|
email varchar(64) not null,
|
|
|
|
email varchar(64) not null,
|
|
|
|
url carchar(1024),
|
|
|
|
url varchar(1024),
|
|
|
|
body text,
|
|
|
|
body text,
|
|
|
|
created timestamp(0) deafult now() not null,
|
|
|
|
created timestamp(0) default now() not null,
|
|
|
|
|
|
|
|
post bigint not null,
|
|
|
|
foreign key (post) references posts(id)
|
|
|
|
foreign key (post) references posts(id)
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|