-
-
Notifications
You must be signed in to change notification settings - Fork 215
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
Conversation
@@ -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.') |
There was a problem hiding this comment.
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'))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"must implement"
👍 |
👍 |
@deeky666 Can you also have a look at it please ? :) |
👍 |
Add --shard option to migrations command
Thanks @guilhermeblanco |
This PR requires doctrine/dbal#896, and is required by doctrine/DoctrineBundle#456
--shard
option to common migrations commands--shard
option todoctrine:migrations:diff
command