1
0
mirror of synced 2025-01-18 22:41:43 +03:00

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

This commit is contained in:
guilhermeblanco 2009-11-25 16:27:18 +00:00
parent 555b097641
commit ba4d1bb393
2 changed files with 39 additions and 4 deletions

View File

@ -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)
{
return $trigger['trigger_name'];

View File

@ -236,10 +236,13 @@ class CliController
* ),
* ),
* 1 => array(
* 'option' => true,
* 'a' => 'value',
* 'optArr' => array(
* 'value1', 'value2'
* 'name' => 'bar',
* 'args' => array(
* 'option' => true,
* 'a' => 'value',
* 'optArr' => array(
* 'value1', 'value2'
* ),
* ),
* ),
* )