start schema

This commit is contained in:
Dan Ballard 2015-04-26 22:37:00 -07:00
parent 83bf6d7cd9
commit fda7152c77
2 changed files with 19 additions and 0 deletions

3
db/dbconf.yml Normal file
View File

@ -0,0 +1,3 @@
development:
driver: postgres
open: user=transmet dbname=transmet password=asdfasdf

View File

@ -0,0 +1,16 @@
-- +goose Up
-- SQL in section 'Up' is executed when this migration is applied
CREATE TABLE tags(tag_id SERIAL PRIMARY KEY, name varchar(255), parent_id INTEGER DEFAULT NULL, PRIMARY KEY(tag_id));
CREATE TABLE news(news_id INTEGER NOT NULL, url varchar(255), title varchar(255), tag_id integer REFERENCES tags, timestamp timestamp, description text, PRIMARY KEY(timestamp));
CREATE TABLE users(username VARCHAR(128), password VARCHAR(128), PRIMARY KEY(username));
-- +goose Down
-- SQL section 'Down' is executed when this migration is rolled back
DROP TABLE tags;
DROP TABLE news;
DROP TABLE users;