From 9e556cb718fd436741762de1aa34197626656c49 Mon Sep 17 00:00:00 2001 From: Sebastian Krebs Date: Sat, 6 Jun 2015 23:28:24 +0200 Subject: [PATCH] Remove dbname reference from database connection configuration There is still the dbname within the url. Need to get rid of this in CreateDatabaseCommand, because else it still tries to connect to the server with this dbname, which probably doesn't exists yet. --- Command/CreateDatabaseDoctrineCommand.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Command/CreateDatabaseDoctrineCommand.php b/Command/CreateDatabaseDoctrineCommand.php index 7e4d90e7e..6f8248d88 100644 --- a/Command/CreateDatabaseDoctrineCommand.php +++ b/Command/CreateDatabaseDoctrineCommand.php @@ -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());