feat(migrations): Add posts & threads tables

This commit is contained in:
Vincent Ambo 2018-04-08 15:48:56 +02:00
parent 106ade6e41
commit 042eb88fd7
5 changed files with 57 additions and 0 deletions

View 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
);