diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2017-10-01 22:38:55 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2017-10-01 22:38:55 +0200 |
commit | 1767eb2dafbab8b19cc4cf0a9a890539ce2948c1 (patch) | |
tree | e8b8942bb9383d2a3986c2d549b1c53863c69ca1 /migrations | |
parent | b62344371e4ce07aa19da5e7faeef322e907653e (diff) | |
download | rocket-blog-1767eb2dafbab8b19cc4cf0a9a890539ce2948c1.tar.gz rocket-blog-1767eb2dafbab8b19cc4cf0a9a890539ce2948c1.tar.bz2 rocket-blog-1767eb2dafbab8b19cc4cf0a9a890539ce2948c1.zip |
Add schema for posts, and display them on index page.
Diffstat (limited to 'migrations')
-rw-r--r-- | migrations/2017-10-01-193613_create_posts/down.sql | 2 | ||||
-rw-r--r-- | migrations/2017-10-01-193613_create_posts/up.sql | 7 |
2 files changed, 9 insertions, 0 deletions
diff --git a/migrations/2017-10-01-193613_create_posts/down.sql b/migrations/2017-10-01-193613_create_posts/down.sql new file mode 100644 index 0000000..e1d6323 --- /dev/null +++ b/migrations/2017-10-01-193613_create_posts/down.sql @@ -0,0 +1,2 @@ +-- Drop posts table +DROP TABLE posts diff --git a/migrations/2017-10-01-193613_create_posts/up.sql b/migrations/2017-10-01-193613_create_posts/up.sql new file mode 100644 index 0000000..c0c36e5 --- /dev/null +++ b/migrations/2017-10-01-193613_create_posts/up.sql @@ -0,0 +1,7 @@ +-- Create posts table +CREATE TABLE posts ( + id SERIAL PRIMARY KEY, + title VARCHAR NOT NULL, + body TEXT NOT NULL, + published BOOLEAN NOT NULL DEFAULT 'f' +) |