diff --git a/src/Illuminate/Database/Console/Migrations/RefreshCommand.php b/src/Illuminate/Database/Console/Migrations/RefreshCommand.php index be2612c63eee..763c2ce523cd 100755 --- a/src/Illuminate/Database/Console/Migrations/RefreshCommand.php +++ b/src/Illuminate/Database/Console/Migrations/RefreshCommand.php @@ -48,11 +48,11 @@ public function fire() if ($step > 0) { $this->call('migrate:rollback', [ - '--database' => $database, '--force' => $force, '--step' => $step, + '--database' => $database, '--force' => $force, '--path' => $path, '--step' => $step, ]); } else { $this->call('migrate:reset', [ - '--database' => $database, '--force' => $force, + '--database' => $database, '--force' => $force, '--path' => $path, ]); } diff --git a/src/Illuminate/Database/Console/Migrations/ResetCommand.php b/src/Illuminate/Database/Console/Migrations/ResetCommand.php index ddc55382c1b8..b691fbab9478 100755 --- a/src/Illuminate/Database/Console/Migrations/ResetCommand.php +++ b/src/Illuminate/Database/Console/Migrations/ResetCommand.php @@ -88,6 +88,8 @@ protected function getOptions() ['force', null, InputOption::VALUE_NONE, 'Force the operation to run when in production.'], + ['path', null, InputOption::VALUE_OPTIONAL, 'The path of migrations files to be executed.'], + ['pretend', null, InputOption::VALUE_NONE, 'Dump the SQL queries that would be run.'], ]; } diff --git a/src/Illuminate/Database/Console/Migrations/RollbackCommand.php b/src/Illuminate/Database/Console/Migrations/RollbackCommand.php index 9fa5e17e696e..ef94443e4f89 100755 --- a/src/Illuminate/Database/Console/Migrations/RollbackCommand.php +++ b/src/Illuminate/Database/Console/Migrations/RollbackCommand.php @@ -81,6 +81,8 @@ protected function getOptions() ['force', null, InputOption::VALUE_NONE, 'Force the operation to run when in production.'], + ['path', null, InputOption::VALUE_OPTIONAL, 'The path of migrations files to be executed.'], + ['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.'], diff --git a/tests/Database/DatabaseMigrationRefreshCommandTest.php b/tests/Database/DatabaseMigrationRefreshCommandTest.php index 92f279cb4e22..43d587758794 100755 --- a/tests/Database/DatabaseMigrationRefreshCommandTest.php +++ b/tests/Database/DatabaseMigrationRefreshCommandTest.php @@ -32,7 +32,7 @@ public function testRefreshCommandCallsCommandsWithProperArguments() $console->shouldReceive('find')->with('migrate:reset')->andReturn($resetCommand); $console->shouldReceive('find')->with('migrate')->andReturn($migrateCommand); - $resetCommand->shouldReceive('run')->with(new InputMatcher("--database --force 'migrate:reset'"), m::any()); + $resetCommand->shouldReceive('run')->with(new InputMatcher("--database --force --path 'migrate:reset'"), m::any()); $migrateCommand->shouldReceive('run')->with(new InputMatcher('--database --force --path migrate'), m::any()); $this->runCommand($command); @@ -54,7 +54,7 @@ public function testRefreshCommandCallsCommandsWithStep() $console->shouldReceive('find')->with('migrate:rollback')->andReturn($rollbackCommand); $console->shouldReceive('find')->with('migrate')->andReturn($migrateCommand); - $rollbackCommand->shouldReceive('run')->with(new InputMatcher("--database --force --step=2 'migrate:rollback'"), m::any()); + $rollbackCommand->shouldReceive('run')->with(new InputMatcher("--database --force --path --step=2 'migrate:rollback'"), m::any()); $migrateCommand->shouldReceive('run')->with(new InputMatcher('--database --force --path migrate'), m::any()); $this->runCommand($command, ['--step' => 2]);