Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --shard option to migrations command #132

Merged
merged 1 commit into from
Nov 4, 2015
Merged

Add --shard option to migrations command #132

merged 1 commit into from
Nov 4, 2015

Conversation

vincentchalamon
Copy link
Contributor

This PR requires doctrine/dbal#896, and is required by doctrine/DoctrineBundle#456

  • Add --shard option to common migrations commands
  • Add --shard option to doctrine:migrations:diff command

@@ -35,6 +35,7 @@ protected function configure()
->setName('doctrine:migrations:latest')
->addOption('db', null, InputOption::VALUE_REQUIRED, 'The database connection to use for this command.')
->addOption('em', null, InputOption::VALUE_REQUIRED, 'The entity manager to use for this command.')
->addOption('shard', null, InputOption::VALUE_OPTIONAL, 'The shard connection to use for this command.')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the value of the option is not optional in the code you wrote.

$connection = $application->getHelperSet()->get('db')->getConnection();
if (!$connection instanceof PoolingShardConnection) {
if (empty($managerNames)) {
throw new \LogicException(sprintf("Connection '%s' must implements shards configuration.", $input->getOption('db')));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"must implement"

@guillaumevoisin
Copy link

👍

@MLKiiwy
Copy link

MLKiiwy commented Sep 3, 2015

👍

@vincentchalamon
Copy link
Contributor Author

@deeky666 Can you also have a look at it please ? :)

@dunglas
Copy link

dunglas commented Oct 29, 2015

👍

guilhermeblanco added a commit that referenced this pull request Nov 4, 2015
Add --shard option to migrations command
@guilhermeblanco guilhermeblanco merged commit 303a576 into doctrine:master Nov 4, 2015
@vincentchalamon
Copy link
Contributor Author

Thanks @guilhermeblanco

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants