Skip to content

Commit

Permalink
fix: Prefer primary config over master.
Browse files Browse the repository at this point in the history
  • Loading branch information
prengerjarno committed Nov 12, 2020
1 parent 5a94ec5 commit 70faa08
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions Command/CreateDatabaseDoctrineCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,17 @@ protected function execute(InputInterface $input, OutputInterface $output)
$driverOptions = $params['driverOptions'];
}

if (isset($params['master'])) {
$params = $params['master'];
$params['driverOptions'] = $driverOptions;
}

// Since doctrine/dbal 2.11 master has been replaced by primary
if (isset($params['primary'])) {
$params = $params['primary'];
$params['driverOptions'] = $driverOptions;
}

if (isset($params['master'])) {
$params = $params['master'];
$params['driverOptions'] = $driverOptions;
}

// Cannot inject `shard` option in parent::getDoctrineConnection
// cause it will try to connect to a non-existing database
if (isset($params['shards'])) {
Expand Down
10 changes: 5 additions & 5 deletions Command/DropDatabaseDoctrineCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,17 @@ protected function execute(InputInterface $input, OutputInterface $output)
$driverOptions = $params['driverOptions'];
}

if (isset($params['master'])) {
$params = $params['master'];
$params['driverOptions'] = $driverOptions;
}

// Since doctrine/dbal 2.11 master has been replaced by primary
if (isset($params['primary'])) {
$params = $params['primary'];
$params['driverOptions'] = $driverOptions;
}

if (isset($params['master'])) {
$params = $params['master'];
$params['driverOptions'] = $driverOptions;
}

if (isset($params['shards'])) {
$shards = $params['shards'];
// Default select global
Expand Down

0 comments on commit 70faa08

Please sign in to comment.