Fix create/drop database against PgSQL. Thanks Hannes and Russ for patch
This commit is contained in:
parent
555b097641
commit
ba4d1bb393
@ -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'];
|
||||
|
@ -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'
|
||||
* ),
|
||||
* ),
|
||||
* ),
|
||||
* )
|
||||
|
Loading…
x
Reference in New Issue
Block a user