Fix db migrations (#212)

This commit is contained in:
Rafael Taranto 2018-11-15 11:31:41 -02:00 committed by Josh Harvey
parent eb033a4174
commit a377777b12
2 changed files with 2 additions and 2 deletions

View file

@ -40,7 +40,7 @@ exports.up = function (next) {
db.addColumn('customers', 'authorized_at', 'timestamptz'),
db.addColumn('customers', 'sanctions_check_at', 'timestamptz'),
db.renameColumn('compliance_authorizations', 'name', 'compliance_overrides'),
'alter table compliance_authorizations rename to compliance_overrides',
db.addColumn('compliance_overrides', 'verification', 'verification_type not null'),
db.renameColumn('compliance_overrides', 'authorized_at', 'override_at'),
db.renameColumn('compliance_overrides', 'authorized_by', 'override_by')

View file

@ -120,7 +120,7 @@ function dropColumn (table, column) {
function renameColumn (table, column, newName) {
return ifColumn(table, column,
ifColumn(table, column, `
ifColumn(table, newName, `
ALTER TABLE ${table}
RENAME ${column} to ${newName}`, true, true))
}