Commit 1625836c authored by Steve Müller's avatar Steve Müller Committed by Marco Pivetta

revert platform check for schemas needing creation

parent 54c67005
......@@ -1788,19 +1788,6 @@ abstract class AbstractPlatform
throw DBALException::notSupported(__METHOD__);
}
/**
* Checks whether the schema $schemaName needs creating.
*
* @param string $schemaName
*
* @return boolean
* @throws \Doctrine\DBAL\DBALException If not supported on this platform.
*/
public function schemaNeedsCreation($schemaName)
{
throw DBALException::notSupported(__METHOD__);
}
/**
* Quotes a string so that it can be safely used as a table or column name,
* even if it is a reserved word of the platform. This also detects identifier
......
......@@ -668,14 +668,6 @@ class PostgreSqlPlatform extends AbstractPlatform
return 'CREATE SCHEMA ' . $schemaName;
}
/**
* {@inheritDoc}
*/
public function schemaNeedsCreation($schemaName)
{
return !in_array($schemaName, array('default', 'public'));
}
/**
* {@inheritDoc}
*/
......
......@@ -155,14 +155,6 @@ class SQLServerPlatform extends AbstractPlatform
return 'CREATE SCHEMA ' . $schemaName;
}
/**
* {@inheritDoc}
*/
public function schemaNeedsCreation($schemaName)
{
return $schemaName !== 'dbo';
}
/**
* {@inheritDoc}
*/
......
......@@ -140,7 +140,7 @@ class CreateSchemaSqlCollector extends AbstractVisitor
$sql = array();
foreach (array_keys($this->createTableQueries) as $namespace) {
if ($this->platform->supportsSchemas() && $this->platform->schemaNeedsCreation($namespace)) {
if ($this->platform->supportsSchemas()) {
$query = $this->platform->getCreateSchemaSQL($namespace);
$sql[] = $query;
}
......
......@@ -506,14 +506,6 @@ abstract class AbstractPlatformTestCase extends \Doctrine\Tests\DbalTestCase
$this->_platform->getCreateSchemaSQL('schema');
}
/**
* @expectedException \Doctrine\DBAL\DBALException
*/
public function testSchemaNeedsCreation()
{
$this->_platform->schemaNeedsCreation('schema');
}
/**
* @group DBAL-585
*/
......
......@@ -387,19 +387,6 @@ abstract class AbstractPostgreSqlPlatformTestCase extends AbstractPlatformTestCa
$this->assertEquals('CREATE SCHEMA ' . $schemaName, $sql);
}
public function testSchemaNeedsCreation()
{
$schemaNames = array(
'default' => false,
'public' => false,
'schema' => true,
);
foreach ($schemaNames as $name => $expected) {
$actual = $this->_platform->schemaNeedsCreation($name);
$this->assertEquals($expected, $actual);
}
}
public function testAlterDecimalPrecisionScale()
{
......
......@@ -472,18 +472,6 @@ abstract class AbstractSQLServerPlatformTestCase extends AbstractPlatformTestCas
$this->assertEquals('CREATE SCHEMA ' . $schemaName, $sql);
}
public function testSchemaNeedsCreation()
{
$schemaNames = array(
'dbo' => false,
'schema' => true,
);
foreach ($schemaNames as $name => $expected) {
$actual = $this->_platform->schemaNeedsCreation($name);
$this->assertEquals($expected, $actual);
}
}
/**
* @group DBAL-543
*/
......
......@@ -10,17 +10,13 @@ class CreateSchemaSqlCollectorTest extends \PHPUnit_Framework_TestCase
{
$platformMock = $this->getMock(
'Doctrine\DBAL\Platforms\PostgreSqlPlatform',
array('supportsSchemas', 'schemaNeedsCreation', 'getCreateTableSQL')
array('supportsSchemas', 'getCreateTableSQL')
);
$platformMock->expects($this->any())
->method('supportsSchemas')
->will($this->returnValue(true));
$platformMock->expects($this->any())
->method('schemaNeedsCreation')
->will($this->returnValue(true));
$platformMock->expects($this->any())
->method('getCreateTableSQL')
->will($this->returnValue(array('foo')));
......
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