Commit 689df3e5 authored by antonioribeiro's avatar antonioribeiro

Postgres fix for a possible unavailable dbname

parent 10be52ae
......@@ -65,6 +65,10 @@ class Driver implements \Doctrine\DBAL\Driver
public function getDatabase(\Doctrine\DBAL\Connection $conn)
{
$params = $conn->getParams();
return $params['dbname'];
if (isset($params['dbname'])) {
return $params['dbname'];
}
return $conn->query('SELECT CURRENT_DATABASE()')->fetchColumn();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment