feat(migrations): Add posts & threads tables
This commit is contained in:
parent
106ade6e41
commit
042eb88fd7
5 changed files with 57 additions and 0 deletions
13
migrations/2018-04-08-133240_create_posts/up.sql
Normal file
13
migrations/2018-04-08-133240_create_posts/up.sql
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
CREATE TABLE threads (
|
||||
id SERIAL PRIMARY KEY,
|
||||
title VARCHAR NOT NULL,
|
||||
body TEXT NOT NULL,
|
||||
posted TIMESTAMPTZ NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE posts (
|
||||
id SERIAL PRIMARY KEY,
|
||||
thread SERIAL REFERENCES threads (id),
|
||||
body TEXT NOT NULL,
|
||||
posted TIMESTAMPTZ NOT NULL
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue