tvl-depot/migrations/2018-04-08-133240_create_posts/up.sql
2018-04-08 15:48:56 +02:00

13 lines
272 B
SQL

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