Skip to content

Commit

Permalink
fix creating and dropping database on PostgreSQL
Browse files Browse the repository at this point in the history
  • Loading branch information
deeky666 authored and Ocramius committed Dec 27, 2014
1 parent 2e4ed5f commit 21a2bf6
Showing 1 changed file with 0 additions and 42 deletions.
42 changes: 0 additions & 42 deletions lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,48 +129,6 @@ protected function _getPortableTableForeignKeyDefinition($tableForeignKey)
);
}

/**
* {@inheritdoc}
*/
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->_conn->close();

$this->_platform = $tmpPlatform;
$this->_conn = $tmpConn;
}

/**
* {@inheritdoc}
*/
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->_conn->close();

$this->_platform = $tmpPlatform;
$this->_conn = $tmpConn;
}

/**
* {@inheritdoc}
*/
Expand Down

0 comments on commit 21a2bf6

Please sign in to comment.