This commit is contained in:
Josh Harvey 2016-11-05 19:18:33 +00:00
parent bcca339ea6
commit ddd277afd6
5 changed files with 45 additions and 8 deletions

View file

@ -0,0 +1,22 @@
var db = require('./db')
exports.up = function (next) {
var sql = [
'drop table if exists users',
`create table user_tokens (
token text PRIMARY KEY,
name text NOT NULL,
created timestamptz NOT NULL default now()
)`,
`create table one_time_passes (
token text PRIMARY KEY,
name text NOT NULL,
created timestamptz NOT NULL default now()
)`
]
db.multi(sql, next)
}
exports.down = function (next) {
next()
}