不要怂,就是干,撸起袖子干!

Commit 81cdd266 by jtschoonhoven

fixed failing test on postgres

1 parent 5ab88d03
Showing with 9 additions and 6 deletions
...@@ -35,6 +35,7 @@ module.exports = (function() { ...@@ -35,6 +35,7 @@ module.exports = (function() {
return new Utils.CustomEventEmitter(function(emitter) { return new Utils.CustomEventEmitter(function(emitter) {
if(options.method === 'down') { if(options.method === 'down') {
self.getCompletedMigrations(function(err, migrations){ self.getCompletedMigrations(function(err, migrations){
migrations.reverse()
self.processMigrations(err, migrations, options, emitter); self.processMigrations(err, migrations, options, emitter);
}); });
} else { } else {
...@@ -365,13 +366,15 @@ module.exports = (function() { ...@@ -365,13 +366,15 @@ module.exports = (function() {
var deleteUndoneMigration = Migrator.prototype.deleteUndoneMigration = function(from, to, callback) { var deleteUndoneMigration = Migrator.prototype.deleteUndoneMigration = function(from, to, callback) {
var self = this; var self = this;
self.findOrCreateSequelizeMetaDAO().success(function(SequelizeMeta) { self.findOrCreateSequelizeMetaDAO().success(function(SequelizeMeta) {
SequelizeMeta SequelizeMeta.find({ where: { from: from.migrationId.toString(), to: to.migrationId.toString() } })
.find({ where: { from: from.migrationId.toString(), to: to.migrationId.toString() } }) .success(function(meta) {
.success(function(meta) { if(meta){
meta.destroy().success(callback); meta.destroy().success(callback)
}); } else {
callback()
}
});
}); });
}; };
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!