Skip to content

Commit

Permalink
Merge pull request #434 from KingCrunch/remove-dbname-createdatabase
Browse files Browse the repository at this point in the history
create:database fails, when dbname is set via URL
  • Loading branch information
guilhermeblanco committed Nov 4, 2015
2 parents f3782a6 + 9e556cb commit a5b3ba9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Command/CreateDatabaseDoctrineCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
if (!$name) {
throw new \InvalidArgumentException("Connection does not contain a 'path' or 'dbname' parameter and cannot be dropped.");
}
unset($params['dbname']);
// Need to get rid of _every_ occurrence of dbname from connection configuration and we have already extracted all relevant info from url
unset($params['dbname'], $params['path'], $params['url']);

$tmpConnection = DriverManager::getConnection($params);
$shouldNotCreateDatabase = $ifNotExists && in_array($name, $tmpConnection->getSchemaManager()->listDatabases());
Expand Down

0 comments on commit a5b3ba9

Please sign in to comment.