13 lines
272 B
SQL
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
|
|
);
|