* dev: (85 commits) chore: console.log debug leftovers fix: third level navigation links fix: show subheader on refresh fix: machines/:id routing fix: customer route chore: update wallet nodes feat: shorten long addresses in funding page feat: shorten long addresses refactor: support copied text different from presented text chore: udpate react, downshift and routing refactor: use Wizard component on first route fix: autocomplete component rendering feat: skip2fa option on .env fix: drop contraint before dropping index chore: stop using alias imports fix: re-instate urlResolver chore: server code formatting chore: reformat code chore: adding eslint and prettier config chore: typo ...
38 lines
912 B
JavaScript
38 lines
912 B
JavaScript
const db = require('./db')
|
|
|
|
exports.up = function (next) {
|
|
var sqls = [
|
|
'CREATE TABLE IF NOT EXISTS user_config ( ' +
|
|
'id serial PRIMARY KEY, ' +
|
|
'type text NOT NULL, ' +
|
|
'data json NOT NULL ' +
|
|
')',
|
|
|
|
'CREATE TABLE IF NOT EXISTS devices ( ' +
|
|
'id serial PRIMARY KEY, ' +
|
|
'fingerprint text NOT NULL UNIQUE, ' +
|
|
'name text, ' +
|
|
'authorized boolean, ' +
|
|
'unpair boolean NOT NULL DEFAULT false' +
|
|
')',
|
|
|
|
'CREATE TABLE IF NOT EXISTS pairing_tokens (' +
|
|
'id serial PRIMARY KEY, ' +
|
|
'token text, ' +
|
|
'created timestamp NOT NULL DEFAULT now() ' +
|
|
')',
|
|
|
|
'CREATE TABLE IF NOT EXISTS users ( ' +
|
|
'id serial PRIMARY KEY, ' +
|
|
'userName text NOT NULL UNIQUE, ' +
|
|
'salt text NOT NULL, ' +
|
|
'pwdHash text NOT NULL ' +
|
|
')',
|
|
]
|
|
|
|
db.multi(sqls, next)
|
|
}
|
|
|
|
exports.down = function (next) {
|
|
next()
|
|
}
|