diff --git a/lib/runner.js b/lib/runner.js index 0c405530..f220c0fe 100644 --- a/lib/runner.js +++ b/lib/runner.js @@ -123,7 +123,7 @@ const getMigrationsToRun = (options, runNames, migrations) => { ); const toRun = (options.timestamp ? downMigrations.filter(({ timestamp }) => timestamp >= options.count) - : downMigrations.slice(-Math.abs(options.count || 1)) + : downMigrations.slice(-Math.abs(options.count === undefined ? 1 : options.count)) ).reverse(); const deletedMigrations = toRun.filter(migration => typeof migration === 'string'); if (deletedMigrations.length) { @@ -137,7 +137,7 @@ const getMigrationsToRun = (options, runNames, migrations) => { ); return (options.timestamp ? upMigrations.filter(({ timestamp }) => timestamp <= options.count) - : upMigrations.slice(0, Math.abs(options.count || Infinity)) + : upMigrations.slice(0, Math.abs(options.count === undefined ? Infinity : options.count)) ); };