diff options
Diffstat (limited to 'migrations/2018-04-08-133240_create_posts/up.sql')
-rw-r--r-- | migrations/2018-04-08-133240_create_posts/up.sql | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/migrations/2018-04-08-133240_create_posts/up.sql b/migrations/2018-04-08-133240_create_posts/up.sql new file mode 100644 index 000000000000..7cf601fa2c54 --- /dev/null +++ b/migrations/2018-04-08-133240_create_posts/up.sql @@ -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 +); |