Skip to content

Commit

Permalink
Merge pull request #483 from hason/sqlite
Browse files Browse the repository at this point in the history
Fix creating sqlite database
  • Loading branch information
guilhermeblanco committed Nov 16, 2015
2 parents a5b3ba9 + e47b0b6 commit c4ffef2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Command/CreateDatabaseDoctrineCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
$params = $params['master'];
}

$name = isset($params['path']) ? $params['path'] : (isset($params['dbname']) ? $params['dbname'] : false);
$hasPath = isset($params['path']);
$name = $hasPath ? $params['path'] : (isset($params['dbname']) ? $params['dbname'] : false);
if (!$name) {
throw new \InvalidArgumentException("Connection does not contain a 'path' or 'dbname' parameter and cannot be dropped.");
}
Expand All @@ -78,7 +79,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$shouldNotCreateDatabase = $ifNotExists && in_array($name, $tmpConnection->getSchemaManager()->listDatabases());

// Only quote if we don't have a path
if (!isset($params['path'])) {
if (!$hasPath) {
$name = $tmpConnection->getDatabasePlatform()->quoteSingleIdentifier($name);
}

Expand Down

0 comments on commit c4ffef2

Please sign in to comment.