WIP
This commit is contained in:
parent
e7960c217c
commit
808a8ab4a4
4 changed files with 74 additions and 14 deletions
|
|
@ -1,9 +1,15 @@
|
|||
var db = require('./db')
|
||||
|
||||
function singleQuotify (item) { return '\'' + item + '\'' }
|
||||
|
||||
exports.up = function (next) {
|
||||
var statuses = ['notSeen', 'published', 'authorized', 'confirmed', 'rejected']
|
||||
.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 authorized boolean NOT NULL DEFAULT false'
|
||||
'alter table transactions add status status_stage NOT NULL DEFAULT \'notSeen\''
|
||||
]
|
||||
db.multi(sql, next)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue