chore: use monorepo organization
This commit is contained in:
parent
deaf7d6ecc
commit
a687827f7e
1099 changed files with 8184 additions and 11535 deletions
38
packages/server/migrations/001-initial.js
Normal file
38
packages/server/migrations/001-initial.js
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
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()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue