Commit ba4d1bb3 authored by guilhermeblanco's avatar guilhermeblanco

Fix create/drop database against PgSQL. Thanks Hannes and Russ for patch

parent 555b0976
...@@ -46,6 +46,38 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager ...@@ -46,6 +46,38 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
} }
} }
public function dropDatabase($database)
{
$params = $this->_conn->getParams();
$params["dbname"] = "postgres";
$tmpPlatform = $this->_platform;
$tmpConn = $this->_conn;
$this->_conn = \Doctrine\DBAL\DriverManager::getConnection($params);
$this->_platform = $this->_conn->getDatabasePlatform();
parent::dropDatabase($database);
$this->_platform = $tmpPlatform;
$this->_conn = $tmpConn;
}
public function createDatabase($database)
{
$params = $this->_conn->getParams();
$params["dbname"] = "postgres";
$tmpPlatform = $this->_platform;
$tmpConn = $this->_conn;
$this->_conn = \Doctrine\DBAL\DriverManager::getConnection($params);
$this->_platform = $this->_conn->getDatabasePlatform();
parent::createDatabase($database);
$this->_platform = $tmpPlatform;
$this->_conn = $tmpConn;
}
protected function _getPortableTriggerDefinition($trigger) protected function _getPortableTriggerDefinition($trigger)
{ {
return $trigger['trigger_name']; return $trigger['trigger_name'];
......
...@@ -236,10 +236,13 @@ class CliController ...@@ -236,10 +236,13 @@ class CliController
* ), * ),
* ), * ),
* 1 => array( * 1 => array(
* 'option' => true, * 'name' => 'bar',
* 'a' => 'value', * 'args' => array(
* 'optArr' => array( * 'option' => true,
* 'value1', 'value2' * 'a' => 'value',
* 'optArr' => array(
* 'value1', 'value2'
* ),
* ), * ),
* ), * ),
* ) * )
......
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