From 1c04c104839c97388b0ac9a692089b7f1de2f746 Mon Sep 17 00:00:00 2001 From: cesar omar Date: Wed, 5 Jun 2019 13:08:36 -0500 Subject: [PATCH 1/2] Update run-migrations-command.js --- commands/run-migrations-command.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/run-migrations-command.js b/commands/run-migrations-command.js index f521cba..32fa97a 100644 --- a/commands/run-migrations-command.js +++ b/commands/run-migrations-command.js @@ -33,7 +33,7 @@ module.exports = function (migrationProvider, adapter, minMigrationTime, logger) function getPending(migrationsList, appliedMigrationIds, minMigrationTime) { var pending = []; migrationsList.forEach(function (migration) { - var id = migration.match(/^(\d+)/)[0]; + var id = +migration.match(/^(\d+)/)[0]; if ((!minMigrationTime || id >= minMigrationTime) && !~appliedMigrationIds.indexOf(id) && migration.match(/^\d+\_up.*$/)) { pending.push(migration); } From 7e6e49bc04d6703e68ddaf5aef13ab9b1e2b13a0 Mon Sep 17 00:00:00 2001 From: cesar omar Date: Mon, 10 Jun 2019 17:43:32 -0500 Subject: [PATCH 2/2] fix getPending if condition --- commands/run-migrations-command.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/run-migrations-command.js b/commands/run-migrations-command.js index 32fa97a..d92bbb5 100644 --- a/commands/run-migrations-command.js +++ b/commands/run-migrations-command.js @@ -34,7 +34,7 @@ function getPending(migrationsList, appliedMigrationIds, minMigrationTime) { var pending = []; migrationsList.forEach(function (migration) { var id = +migration.match(/^(\d+)/)[0]; - if ((!minMigrationTime || id >= minMigrationTime) && !~appliedMigrationIds.indexOf(id) && migration.match(/^\d+\_up.*$/)) { + if ((!minMigrationTime || id >= minMigrationTime) && !~appliedMigrationIds.indexOf(id) && /^\d+\_up.*$/.test(migration)) { pending.push(migration); } });