Merge pull request #1257 from vtalbot/develop

Add bundle:uninstall, bundle:unpublish, migrate:rollback and migrate:reset for bundles
This commit is contained in:
Taylor Otwell
2013-01-05 13:20:10 -08:00
4 changed files with 94 additions and 2 deletions

View File

@@ -103,9 +103,23 @@ class Migrator extends Task {
{
$migrations = $this->resolver->last();
// If bundles supplied, filter migrations to rollback only bundles'
// migrations.
if (count($arguments) > 0)
{
$bundles = $arguments;
if ( ! is_array($bundles)) $bundles = array($bundles);
$migrations = array_filter($migrations, function($migration) use ($bundles)
{
return in_array($migration['bundle'], $bundles);
});
}
if (count($migrations) == 0)
{
echo "Nothing to rollback.";
echo "Nothing to rollback.".PHP_EOL;
return false;
}
@@ -136,7 +150,7 @@ class Migrator extends Task {
*/
public function reset($arguments = array())
{
while ($this->rollback()) {};
while ($this->rollback($arguments)) {};
}
/**