Commit 899c98d0 authored by Guilherme Blanco's avatar Guilherme Blanco

Merge pull request #375 from flip111/patch-1

Update SQLServerPlatform.php by adding methods related to schema.
parents e0ffc8a9 f8760697
...@@ -163,6 +163,22 @@ class SQLServerPlatform extends AbstractPlatform ...@@ -163,6 +163,22 @@ class SQLServerPlatform extends AbstractPlatform
return false; return false;
} }
/**
* {@inheritDoc}
*/
public function getCreateSchemaSQL($schemaName)
{
return 'CREATE SCHEMA ' . $schemaName;
}
/**
* {@inheritDoc}
*/
public function schemaNeedsCreation($schemaName)
{
return $schemaName !== 'dbo';
}
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
......
...@@ -317,4 +317,23 @@ class SQLServerPlatformTest extends AbstractPlatformTestCase ...@@ -317,4 +317,23 @@ class SQLServerPlatformTest extends AbstractPlatformTestCase
'ALTER TABLE [quoted] ADD CONSTRAINT FK_WITH_INTENDED_QUOTATION FOREIGN KEY ([create], foo, [bar]) REFERENCES [foo-bar] ([create], bar, [foo-bar])', 'ALTER TABLE [quoted] ADD CONSTRAINT FK_WITH_INTENDED_QUOTATION FOREIGN KEY ([create], foo, [bar]) REFERENCES [foo-bar] ([create], bar, [foo-bar])',
); );
} }
public function testGetCreateSchemaSQL()
{
$schemaName = 'schema';
$sql = $this->_platform->getCreateSchemaSQL($schemaName);
$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);
}
}
} }
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