Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial entry of new commands for migrations integration
- Loading branch information
Showing
6 changed files
with
292 additions
and
0 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
src/Symfony/Framework/DoctrineBundle/Command/MigrationsDiffDoctrineCommand.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
namespace Symfony\Framework\DoctrineBundle\Command; | ||
|
||
use Symfony\Components\Console\Input\InputInterface; | ||
use Symfony\Components\Console\Output\OutputInterface; | ||
use Symfony\Components\Console\Input\InputOption; | ||
use DoctrineExtensions\Migrations\Tools\Console\Command\DiffCommand; | ||
|
||
/* | ||
* This file is part of the Symfony framework. | ||
* | ||
* (c) Fabien Potencier <fabien.potencier@symfony-project.com> | ||
* | ||
* This source file is subject to the MIT license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
/** | ||
* Command for generate migration classes by comparing your current database schema | ||
* to your mapping information. | ||
* | ||
* @package Symfony | ||
* @subpackage Framework_DoctrineBundle | ||
* @author Fabien Potencier <fabien.potencier@symfony-project.com> | ||
* @author Jonathan H. Wage <jonwage@gmail.com> | ||
*/ | ||
class MigrationsDiffDoctrineCommand extends DiffCommand | ||
{ | ||
protected function configure() | ||
{ | ||
parent::configure(); | ||
|
||
$this | ||
->setName('doctrine:migrations:diff') | ||
->addOption('bundle', null, InputOption::PARAMETER_REQUIRED, 'The bundle to load migrations configuration from.') | ||
->addOption('em', null, InputOption::PARAMETER_OPTIONAL, 'The entity manager to use for this command.') | ||
; | ||
} | ||
|
||
public function execute(InputInterface $input, OutputInterface $output) | ||
{ | ||
DoctrineCommand::setApplicationEntityManager($this->application, $input->getOption('em')); | ||
|
||
$configuration = $this->_getMigrationConfiguration($input, $output); | ||
DoctrineCommand::configureMigrationsForBundle($this->application, $input->getOption('bundle'), $configuration); | ||
|
||
parent::execute($input, $output); | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
src/Symfony/Framework/DoctrineBundle/Command/MigrationsExecuteDoctrineCommand.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
namespace Symfony\Framework\DoctrineBundle\Command; | ||
|
||
use Symfony\Components\Console\Input\InputInterface; | ||
use Symfony\Components\Console\Output\OutputInterface; | ||
use Symfony\Components\Console\Input\InputOption; | ||
use DoctrineExtensions\Migrations\Tools\Console\Command\ExecuteCommand; | ||
|
||
/* | ||
* This file is part of the Symfony framework. | ||
* | ||
* (c) Fabien Potencier <fabien.potencier@symfony-project.com> | ||
* | ||
* This source file is subject to the MIT license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
/** | ||
* Command for executing single migrations up or down manually. | ||
* | ||
* @package Symfony | ||
* @subpackage Framework_DoctrineBundle | ||
* @author Fabien Potencier <fabien.potencier@symfony-project.com> | ||
* @author Jonathan H. Wage <jonwage@gmail.com> | ||
*/ | ||
class MigrationsExecuteDoctrineCommand extends ExecuteCommand | ||
{ | ||
protected function configure() | ||
{ | ||
parent::configure(); | ||
|
||
$this | ||
->setName('doctrine:migrations:execute') | ||
->addOption('bundle', null, InputOption::PARAMETER_REQUIRED, 'The bundle to load migrations configuration from.') | ||
->addOption('em', null, InputOption::PARAMETER_OPTIONAL, 'The entity manager to use for this command.') | ||
; | ||
} | ||
|
||
public function execute(InputInterface $input, OutputInterface $output) | ||
{ | ||
DoctrineCommand::setApplicationEntityManager($this->application, $input->getOption('em')); | ||
|
||
$configuration = $this->_getMigrationConfiguration($input, $output); | ||
DoctrineCommand::configureMigrationsForBundle($this->application, $input->getOption('bundle'), $configuration); | ||
|
||
parent::execute($input, $output); | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
src/Symfony/Framework/DoctrineBundle/Command/MigrationsGenerateDoctrineCommand.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
namespace Symfony\Framework\DoctrineBundle\Command; | ||
|
||
use Symfony\Components\Console\Input\InputInterface; | ||
use Symfony\Components\Console\Output\OutputInterface; | ||
use Symfony\Components\Console\Input\InputOption; | ||
use DoctrineExtensions\Migrations\Tools\Console\Command\GenerateCommand; | ||
|
||
/* | ||
* This file is part of the Symfony framework. | ||
* | ||
* (c) Fabien Potencier <fabien.potencier@symfony-project.com> | ||
* | ||
* This source file is subject to the MIT license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
/** | ||
* Command for generating new blank migration classes | ||
* | ||
* @package Symfony | ||
* @subpackage Framework_DoctrineBundle | ||
* @author Fabien Potencier <fabien.potencier@symfony-project.com> | ||
* @author Jonathan H. Wage <jonwage@gmail.com> | ||
*/ | ||
class MigrationsGenerateDoctrineCommand extends GenerateCommand | ||
{ | ||
protected function configure() | ||
{ | ||
parent::configure(); | ||
|
||
$this | ||
->setName('doctrine:migrations:generate') | ||
->addOption('bundle', null, InputOption::PARAMETER_REQUIRED, 'The bundle to load migrations configuration from.') | ||
->addOption('em', null, InputOption::PARAMETER_OPTIONAL, 'The entity manager to use for this command.') | ||
; | ||
} | ||
|
||
public function execute(InputInterface $input, OutputInterface $output) | ||
{ | ||
DoctrineCommand::setApplicationEntityManager($this->application, $input->getOption('em')); | ||
|
||
$configuration = $this->_getMigrationConfiguration($input, $output); | ||
DoctrineCommand::configureMigrationsForBundle($this->application, $input->getOption('bundle'), $configuration); | ||
|
||
parent::execute($input, $output); | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
src/Symfony/Framework/DoctrineBundle/Command/MigrationsMigrateDoctrineCommand.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
namespace Symfony\Framework\DoctrineBundle\Command; | ||
|
||
use Symfony\Components\Console\Input\InputInterface; | ||
use Symfony\Components\Console\Output\OutputInterface; | ||
use Symfony\Components\Console\Input\InputOption; | ||
use DoctrineExtensions\Migrations\Tools\Console\Command\MigrateCommand; | ||
|
||
/* | ||
* This file is part of the Symfony framework. | ||
* | ||
* (c) Fabien Potencier <fabien.potencier@symfony-project.com> | ||
* | ||
* This source file is subject to the MIT license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
/** | ||
* Command for executing a migration to a specified version or the latest available version. | ||
* | ||
* @package Symfony | ||
* @subpackage Framework_DoctrineBundle | ||
* @author Fabien Potencier <fabien.potencier@symfony-project.com> | ||
* @author Jonathan H. Wage <jonwage@gmail.com> | ||
*/ | ||
class MigrationsMigrateDoctrineCommand extends MigrateCommand | ||
{ | ||
protected function configure() | ||
{ | ||
parent::configure(); | ||
|
||
$this | ||
->setName('doctrine:migrations:migrate') | ||
->addOption('bundle', null, InputOption::PARAMETER_REQUIRED, 'The bundle to load migrations configuration from.') | ||
->addOption('em', null, InputOption::PARAMETER_OPTIONAL, 'The entity manager to use for this command.') | ||
; | ||
} | ||
|
||
public function execute(InputInterface $input, OutputInterface $output) | ||
{ | ||
DoctrineCommand::setApplicationEntityManager($this->application, $input->getOption('em')); | ||
|
||
$configuration = $this->_getMigrationConfiguration($input, $output); | ||
DoctrineCommand::configureMigrationsForBundle($this->application, $input->getOption('bundle'), $configuration); | ||
|
||
parent::execute($input, $output); | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
src/Symfony/Framework/DoctrineBundle/Command/MigrationsStatusDoctrineCommand.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
namespace Symfony\Framework\DoctrineBundle\Command; | ||
|
||
use Symfony\Components\Console\Input\InputInterface; | ||
use Symfony\Components\Console\Output\OutputInterface; | ||
use Symfony\Components\Console\Input\InputOption; | ||
use DoctrineExtensions\Migrations\Tools\Console\Command\StatusCommand; | ||
|
||
/* | ||
* This file is part of the Symfony framework. | ||
* | ||
* (c) Fabien Potencier <fabien.potencier@symfony-project.com> | ||
* | ||
* This source file is subject to the MIT license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
/** | ||
* Command to view the status of a set of migrations. | ||
* | ||
* @package Symfony | ||
* @subpackage Framework_DoctrineBundle | ||
* @author Fabien Potencier <fabien.potencier@symfony-project.com> | ||
* @author Jonathan H. Wage <jonwage@gmail.com> | ||
*/ | ||
class MigrationsStatusDoctrineCommand extends StatusCommand | ||
{ | ||
protected function configure() | ||
{ | ||
parent::configure(); | ||
|
||
$this | ||
->setName('doctrine:migrations:status') | ||
->addOption('bundle', null, InputOption::PARAMETER_REQUIRED, 'The bundle to load migrations configuration from.') | ||
->addOption('em', null, InputOption::PARAMETER_OPTIONAL, 'The entity manager to use for this command.') | ||
; | ||
} | ||
|
||
public function execute(InputInterface $input, OutputInterface $output) | ||
{ | ||
DoctrineCommand::setApplicationEntityManager($this->application, $input->getOption('em')); | ||
|
||
$configuration = $this->_getMigrationConfiguration($input, $output); | ||
DoctrineCommand::configureMigrationsForBundle($this->application, $input->getOption('bundle'), $configuration); | ||
|
||
parent::execute($input, $output); | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
src/Symfony/Framework/DoctrineBundle/Command/MigrationsVersionDoctrineCommand.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
namespace Symfony\Framework\DoctrineBundle\Command; | ||
|
||
use Symfony\Components\Console\Input\InputInterface; | ||
use Symfony\Components\Console\Output\OutputInterface; | ||
use Symfony\Components\Console\Input\InputOption; | ||
use DoctrineExtensions\Migrations\Tools\Console\Command\VersionCommand; | ||
|
||
/* | ||
* This file is part of the Symfony framework. | ||
* | ||
* (c) Fabien Potencier <fabien.potencier@symfony-project.com> | ||
* | ||
* This source file is subject to the MIT license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
/** | ||
* Command for manually adding and deleting migration versions from the version table. | ||
* | ||
* @package Symfony | ||
* @subpackage Framework_DoctrineBundle | ||
* @author Fabien Potencier <fabien.potencier@symfony-project.com> | ||
* @author Jonathan H. Wage <jonwage@gmail.com> | ||
*/ | ||
class MigrationsVersionDoctrineCommand extends VersionCommand | ||
{ | ||
protected function configure() | ||
{ | ||
parent::configure(); | ||
|
||
$this | ||
->setName('doctrine:migrations:version') | ||
->addOption('bundle', null, InputOption::PARAMETER_REQUIRED, 'The bundle to load migrations configuration from.') | ||
->addOption('em', null, InputOption::PARAMETER_OPTIONAL, 'The entity manager to use for this command.') | ||
; | ||
} | ||
|
||
public function execute(InputInterface $input, OutputInterface $output) | ||
{ | ||
DoctrineCommand::setApplicationEntityManager($this->application, $input->getOption('em')); | ||
|
||
parent::execute($input, $output); | ||
} | ||
} |