From 70f0acadd4296d7445d38aa4f4e0795061cd859d Mon Sep 17 00:00:00 2001 From: Benjamin Schuster-Boeckler Date: Tue, 18 Apr 2017 17:48:55 +0100 Subject: [PATCH] Fix async.each in migration (#262) --- lib/migration.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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);