From f23faefbb2c48b5a196b889158ae57cdf9f03582 Mon Sep 17 00:00:00 2001 From: rez1pro Date: Sun, 19 Jan 2025 00:41:12 +0600 Subject: [PATCH] feat: add interactive migration selection for rollback command --- src/Illuminate/Database/Console/Migrations/RollbackCommand.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Database/Console/Migrations/RollbackCommand.php b/src/Illuminate/Database/Console/Migrations/RollbackCommand.php index 7525a63df98..1bdc4db6feb 100755 --- a/src/Illuminate/Database/Console/Migrations/RollbackCommand.php +++ b/src/Illuminate/Database/Console/Migrations/RollbackCommand.php @@ -62,7 +62,7 @@ public function handle() // if step or batch is not set, we need to rollback all migrations $migrations = []; - if (($this->option('step') == null && $this->option('batch') == null)) { + if (($this->option('select'))) { $migrations = $this->getMigrationsForRollback(); } @@ -97,6 +97,7 @@ protected function getOptions() ['pretend', null, InputOption::VALUE_NONE, 'Dump the SQL queries that would be run'], ['step', null, InputOption::VALUE_OPTIONAL, 'The number of migrations to be reverted'], ['batch', null, InputOption::VALUE_REQUIRED, 'The batch of migrations (identified by their batch number) to be reverted'], + ['select', null, InputOption::VALUE_NONE, 'Select the migrations to rollback'], ]; }