DB Migrations

Replacing modl’s built-in table creation and removal
with manual migrations. Thanks to @DavidHuie for
gomigrate!
This commit is contained in:
Matthew Dillon 2014-10-06 17:09:41 -08:00
parent c5f94ab67d
commit 8fa594e3f0
6 changed files with 53 additions and 17 deletions

View file

@ -0,0 +1,5 @@
-- bactdb
-- Matthew R Dillon
DROP TABLE users;

View file

@ -0,0 +1,19 @@
-- bactdb
-- Matthew R Dillon
CREATE TABLE users (
id BIGSERIAL NOT NULL,
username CHARACTER VARYING(100),
createdat TIMESTAMP WITH TIME ZONE,
updatedat TIMESTAMP WITH TIME ZONE,
deletedat TIMESTAMP WITH TIME ZONE,
CONSTRAINT users_pkey PRIMARY KEY (id)
);
CREATE UNIQUE INDEX username_idx
ON users
USING btree
(username COLLATE pg_catalog."default");