From 5d3d0dfa4399bab2c9362e29444bb184d5d28da2 Mon Sep 17 00:00:00 2001 From: Angger Pradana Date: Sun, 13 Oct 2024 10:00:59 +0700 Subject: [PATCH] fix: migration always use latest batch instead using take (#397) - remove `take` option from running migration --- src/System/Integrate/Console/MigrationCommand.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/System/Integrate/Console/MigrationCommand.php b/src/System/Integrate/Console/MigrationCommand.php index 0ad7c82f..7b04562a 100644 --- a/src/System/Integrate/Console/MigrationCommand.php +++ b/src/System/Integrate/Console/MigrationCommand.php @@ -96,7 +96,7 @@ public function printHelp() 'database:show' => 'Show database table', ], 'options' => [ - '--take' => 'Number of migrations to be run.', + '--take' => 'Limit of migrations to be run.', '--batch' => 'Batch migration excution.', '--dry-run' => 'Excute migration but olny get query output.', '--force' => 'Force runing migration/database query in production.', @@ -105,7 +105,7 @@ public function printHelp() '--yes' => 'Accept it without having it ask any questions', ], 'relation' => [ - 'migrate' => ['--take', '--seed', '--dry-run', '--force'], + 'migrate' => ['--seed', '--dry-run', '--force'], 'migrate:fresh' => ['--seed', '--dry-run', '--force'], 'migrate:reset' => ['--dry-run', '--force'], 'migrate:refresh' => ['--seed', '--dry-run', '--force'], @@ -235,9 +235,8 @@ public function migration(bool $silent = false): int $width = $this->getWidth(40, 60); $batch = false; $migrate = $this->baseMigrate($batch); - $take = $this->option('take', $batch); $migrate - ->filter(static fn ($value): bool => $value['batch'] >= $batch - $take) + ->filter(static fn ($value): bool => $value['batch'] == $batch) ->sort(); $print->tap(info('Running migration'));