Skip to content

Commit 70f0aca

Browse files
DaGaMsSakib Hasan
authored and
Sakib Hasan
committed
Fix async.each in migration (loopbackio#262)
1 parent f2f0dac commit 70f0aca

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/migration.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ function mixinMigration(MySQL, mysql) {
5858

5959
models = models || Object.keys(this._models);
6060

61-
async.each(models, function(model, done) {
61+
async.eachSeries(models, function(model, done) {
6262
if (!(model in self._models)) {
6363
return process.nextTick(function() {
6464
done(new Error(g.f('Model not found: %s', model)));
@@ -136,7 +136,7 @@ function mixinMigration(MySQL, mysql) {
136136

137137
models = models || Object.keys(this._models);
138138

139-
async.each(models, function(model, done) {
139+
async.eachSeries(models, function(model, done) {
140140
self.getTableStatus(model, function(err, fields, indexes) {
141141
self.discoverForeignKeys(self.table(model), {}, function(err, foreignKeys) {
142142
if (err) console.log('Failed to discover "' + table + '" foreign keys', err);

0 commit comments

Comments
 (0)