diff --git a/lib/migration.js b/lib/migration.js index ce8950b..1d097ed 100644 --- a/lib/migration.js +++ b/lib/migration.js @@ -58,7 +58,7 @@ function mixinMigration(MySQL, mysql) { models = models || Object.keys(this._models); - async.each(models, function(model, done) { + async.eachSeries(models, function(model, done) { if (!(model in self._models)) { return process.nextTick(function() { done(new Error(g.f('Model not found: %s', model))); @@ -136,7 +136,7 @@ function mixinMigration(MySQL, mysql) { models = models || Object.keys(this._models); - async.each(models, function(model, done) { + async.eachSeries(models, function(model, done) { self.getTableStatus(model, function(err, fields, indexes) { self.discoverForeignKeys(self.table(model), {}, function(err, foreignKeys) { if (err) console.log('Failed to discover "' + table + '" foreign keys', err);