Migration sql changes (#199)

* safe migration script changes

* lamassu migration script fixes
This commit is contained in:
Fabio Cigliano 2018-11-02 00:26:48 +13:00 committed by Josh Harvey
parent 65ce8aee3d
commit 12c834469c
53 changed files with 500 additions and 346 deletions

View file

@ -4,7 +4,7 @@ exports.up = function (next) {
var sql = [
'drop table if exists devices',
'drop table if exists paired_devices',
`create table devices (
`create table if not exists devices (
device_id text PRIMARY KEY,
name text NOT NULL,
cashbox integer NOT NULL default 0,
@ -14,7 +14,7 @@ exports.up = function (next) {
display boolean NOT NULL default TRUE,
created timestamptz NOT NULL default now()
)`,
'alter table pairing_tokens add column name text NOT NULL'
db.addColumn('pairing_tokens', 'name', 'text NOT NULL')
]
db.multi(sql, next)
}