mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-15 05:45:33 +08:00
Merge branch 'methods_for_schema_builder' of https://github.com/vaseninm/yii2 into vaseninm-methods_for_schema_builder
This commit is contained in:
@@ -95,4 +95,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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user