lamassu-server/migrations/017-user_tokens.js
Rafael Taranto 06f8c57608 Save migrations file on db (#215)
* Revert "Migration sql changes (#199)"

This reverts commit 12c834469c.

* Save migrate file on db

* Add message on migration error in lamassu-update
2018-11-18 10:15:22 +01:00

22 lines
471 B
JavaScript

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()
}