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