diff --git a/src/Symfony/Framework/DoctrineBundle/Command/MigrationsDiffDoctrineCommand.php b/src/Symfony/Framework/DoctrineBundle/Command/MigrationsDiffDoctrineCommand.php new file mode 100644 index 0000000000..7f38e088e0 --- /dev/null +++ b/src/Symfony/Framework/DoctrineBundle/Command/MigrationsDiffDoctrineCommand.php @@ -0,0 +1,50 @@ + + * + * 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 + * @author Jonathan H. Wage + */ +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); + } +} \ No newline at end of file diff --git a/src/Symfony/Framework/DoctrineBundle/Command/MigrationsExecuteDoctrineCommand.php b/src/Symfony/Framework/DoctrineBundle/Command/MigrationsExecuteDoctrineCommand.php new file mode 100644 index 0000000000..a65d53ea9f --- /dev/null +++ b/src/Symfony/Framework/DoctrineBundle/Command/MigrationsExecuteDoctrineCommand.php @@ -0,0 +1,49 @@ + + * + * 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 + * @author Jonathan H. Wage + */ +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); + } +} \ No newline at end of file diff --git a/src/Symfony/Framework/DoctrineBundle/Command/MigrationsGenerateDoctrineCommand.php b/src/Symfony/Framework/DoctrineBundle/Command/MigrationsGenerateDoctrineCommand.php new file mode 100644 index 0000000000..a45c05c13c --- /dev/null +++ b/src/Symfony/Framework/DoctrineBundle/Command/MigrationsGenerateDoctrineCommand.php @@ -0,0 +1,49 @@ + + * + * 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 + * @author Jonathan H. Wage + */ +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); + } +} \ No newline at end of file diff --git a/src/Symfony/Framework/DoctrineBundle/Command/MigrationsMigrateDoctrineCommand.php b/src/Symfony/Framework/DoctrineBundle/Command/MigrationsMigrateDoctrineCommand.php new file mode 100644 index 0000000000..6235c88def --- /dev/null +++ b/src/Symfony/Framework/DoctrineBundle/Command/MigrationsMigrateDoctrineCommand.php @@ -0,0 +1,49 @@ + + * + * 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 + * @author Jonathan H. Wage + */ +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); + } +} \ No newline at end of file diff --git a/src/Symfony/Framework/DoctrineBundle/Command/MigrationsStatusDoctrineCommand.php b/src/Symfony/Framework/DoctrineBundle/Command/MigrationsStatusDoctrineCommand.php new file mode 100644 index 0000000000..19122b5b24 --- /dev/null +++ b/src/Symfony/Framework/DoctrineBundle/Command/MigrationsStatusDoctrineCommand.php @@ -0,0 +1,49 @@ + + * + * 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 + * @author Jonathan H. Wage + */ +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); + } +} \ No newline at end of file diff --git a/src/Symfony/Framework/DoctrineBundle/Command/MigrationsVersionDoctrineCommand.php b/src/Symfony/Framework/DoctrineBundle/Command/MigrationsVersionDoctrineCommand.php new file mode 100644 index 0000000000..89b3ed3abd --- /dev/null +++ b/src/Symfony/Framework/DoctrineBundle/Command/MigrationsVersionDoctrineCommand.php @@ -0,0 +1,46 @@ + + * + * 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 + * @author Jonathan H. Wage + */ +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); + } +} \ No newline at end of file