Add task bundle:uninstall, bundle:unpublish, migrate:rollback bundle, migrate:reset bundle.

This commit is contained in:
vtalbot
2012-09-20 22:15:29 -04:00
parent 6c55f9cf54
commit 8931369665
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)) {};
}
/**