add comment control methods

This commit is contained in:
Matvey Vasenin
2015-08-14 12:27:21 +03:00
parent ff87dd2bd7
commit ce6e92b736
8 changed files with 345 additions and 1 deletions

View File

@@ -126,4 +126,30 @@ class PostgreSQLQueryBuilderTest extends QueryBuilderTest
$sql = $qb->alterColumn('foo1', 'bar', 'reset xyz');
$this->assertEquals($expected, $sql);
}
public function testCommentColumn()
{
$qb = $this->getQueryBuilder();
$expected = "COMMENT ON COLUMN \"comment\".\"text\" IS 'This is my column.'";
$sql = $qb->addCommentOnColumn('comment', 'text', 'This is my column.');
$this->assertEquals($expected, $sql);
$expected = "COMMENT ON COLUMN \"comment\".\"text\" IS NULL";
$sql = $qb->dropCommentFromColumn('comment', 'text');
$this->assertEquals($expected, $sql);
}
public function testCommentTable()
{
$qb = $this->getQueryBuilder();
$expected = "COMMENT ON TABLE \"comment\" IS 'This is my table.'";
$sql = $qb->addCommentOnTable('comment', 'This is my table.');
$this->assertEquals($expected, $sql);
$expected = "COMMENT ON TABLE \"comment\" IS NULL";
$sql = $qb->dropCommentFromTable('comment');
$this->assertEquals($expected, $sql);
}
}