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

@ -8,12 +8,12 @@ exports.up = function (next) {
.map(singleQuotify).join(',')
var sql = [
'create type status_stage AS enum (' + statuses + ')',
'alter table transactions add dispensed boolean NOT NULL DEFAULT false',
'alter table transactions add notified boolean NOT NULL DEFAULT false',
'alter table transactions add redeem boolean NOT NULL DEFAULT false',
'alter table transactions add confirmation_time timestamptz',
'alter table transactions add status status_stage NOT NULL DEFAULT \'notSeen\''
db.defineEnum('status_stage', statuses),
db.addColumn('transactions', 'dispensed', 'boolean NOT NULL DEFAULT false'),
db.addColumn('transactions', 'notified', 'boolean NOT NULL DEFAULT false'),
db.addColumn('transactions', 'redeem', 'boolean NOT NULL DEFAULT false'),
db.addColumn('transactions', 'confirmation_time', 'timestamptz'),
db.addColumn('transactions', 'status', 'status_stage NOT NULL DEFAULT \'notSeen\'')
]
db.multi(sql, next)
}