Commit 45975b07 authored by Benjamin Eberlei's avatar Benjamin Eberlei

[DBAL-42] Column comments

parent c330d97c
......@@ -88,6 +88,11 @@ class Column extends AbstractAsset
*/
protected $_columnDefinition = null;
/**
* @var string
*/
protected $_comment = null;
/**
* Create a new Column
*
......@@ -316,6 +321,17 @@ class Column extends AbstractAsset
return $this;
}
public function setComment($comment)
{
$this->_comment = $comment;
return $this;
}
public function getComment()
{
return $this->_comment;
}
/**
* @param Visitor $visitor
*/
......
......@@ -87,4 +87,16 @@ class ColumnTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('`bar`', $column->getQuotedName($mysqlPlatform));
$this->assertEquals('"bar"', $column->getQuotedName($sqlitePlatform));
}
/**
* @group DBAL-42
*/
public function testColumnComment()
{
$column = new Column("`bar`", Type::getType('string'));
$this->assertNull($column->getComment());
$column->setComment("foo");
$this->assertEquals("foo", $column->getComment());
}
}
\ No newline at end of file
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