Commit f2e6fa86 authored by Steve Müller's avatar Steve Müller

add support for column comments in SQL Server

parent 25a1cced
......@@ -80,6 +80,8 @@ class SQLServerSchemaManager extends AbstractSchemaManager
}
$type = $this->_platform->getDoctrineTypeMapping($dbType);
$type = $this->extractDoctrineTypeFromComment($tableColumn['comment'], $type);
$tableColumn['comment'] = $this->removeDoctrineTypeFromComment($tableColumn['comment'], $type);
switch ($type) {
case 'char':
......@@ -99,6 +101,7 @@ class SQLServerSchemaManager extends AbstractSchemaManager
'scale' => $tableColumn['scale'],
'precision' => $tableColumn['precision'],
'autoincrement' => (bool) $tableColumn['autoincrement'],
'comment' => $tableColumn['comment'] !== '' ? $tableColumn['comment'] : null,
);
$platformOptions = array(
......
......@@ -522,7 +522,9 @@ class SchemaManagerFunctionalTestCase extends \Doctrine\Tests\DbalFunctionalTest
*/
public function testGetColumnComment()
{
if (!$this->_conn->getDatabasePlatform()->supportsInlineColumnComments() && !$this->_conn->getDatabasePlatform()->supportsCommentOnStatement()) {
if ( ! $this->_conn->getDatabasePlatform()->supportsInlineColumnComments() &&
! $this->_conn->getDatabasePlatform()->supportsCommentOnStatement() &&
! $this->_conn->getDatabasePlatform()->getName() == 'mssql') {
$this->markTestSkipped('Database does not support column comments.');
}
......@@ -556,7 +558,9 @@ class SchemaManagerFunctionalTestCase extends \Doctrine\Tests\DbalFunctionalTest
*/
public function testAutomaticallyAppendCommentOnMarkedColumns()
{
if (!$this->_conn->getDatabasePlatform()->supportsInlineColumnComments() && !$this->_conn->getDatabasePlatform()->supportsCommentOnStatement()) {
if ( ! $this->_conn->getDatabasePlatform()->supportsInlineColumnComments() &&
! $this->_conn->getDatabasePlatform()->supportsCommentOnStatement() &&
! $this->_conn->getDatabasePlatform()->getName() == 'mssql') {
$this->markTestSkipped('Database does not support column comments.');
}
......
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