clean up migrations

This commit is contained in:
Josh Harvey 2017-05-07 18:52:33 +03:00
parent 393f45a1b3
commit 94ee178c65
4 changed files with 40 additions and 38 deletions

View file

@ -59,16 +59,11 @@ exports.up = function (next) {
'created timestamp NOT NULL DEFAULT now() ' +
')',
'CREATE INDEX ON dispenses (device_fingerprint)'
];
]
// Need to call this separately to ignore error
// in case transactions doesn't exist
var renameSql = 'ALTER TABLE transactions RENAME TO transactions_old';
db.silentQuery(renameSql, function() {
db.multi(sqls, next);
});
};
db.multi(sqls, next)
}
exports.down = function(next) {
next();
};
exports.down = function (next) {
next()
}