Skip to content

Commit

Permalink
Added back "--path" for migrations
Browse files Browse the repository at this point in the history
Signed-off-by: Graham Campbell <graham@mineuk.com>
  • Loading branch information
darryldecode authored and GrahamCampbell committed Feb 2, 2015
1 parent 8a19d18 commit cb0ccaa
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/Illuminate/Database/Console/Migrations/MigrateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,17 @@ public function fire()
// a database for real, which is helpful for double checking migrations.
$pretend = $this->input->getOption('pretend');

$path = $this->getMigrationPath();
// Next, we will check to see if a path option has been defined. If it has
// we will use the path relative to the root of this installation folder
// so that migrations may be run for any path within the applications.
if( ! is_null($path = $this->input->getOption('path')))
{
$path = $this->laravel['path.base'].'/'.$path;
}
else
{
$path = $this->getMigrationPath();
}

$this->migrator->run($path, $pretend);

Expand Down Expand Up @@ -106,6 +116,8 @@ protected function getOptions()
return array(
array('database', null, InputOption::VALUE_OPTIONAL, 'The database connection to use.'),

array('path', null, InputOption::VALUE_OPTIONAL, 'The path of migrations files to be executed. If not provided, it will use the default migrations path.'),

array('force', null, InputOption::VALUE_NONE, 'Force the operation to run when in production.'),

array('pretend', null, InputOption::VALUE_NONE, 'Dump the SQL queries that would be run.'),
Expand Down

0 comments on commit cb0ccaa

Please sign in to comment.