yii\db\Migration::addCommentOnTable PHP Method

addCommentOnTable() public method

Builds a SQL statement for adding comment to table
Since: 2.0.8
public addCommentOnTable ( string $table, string $comment )
$table string the table whose column is to be commented. The table name will be properly quoted by the method.
$comment string the text of the comment to be added. The comment will be properly quoted by the method.
    public function addCommentOnTable($table, $comment)
    {
        echo "    > add comment on table {$table} ...";
        $time = microtime(true);
        $this->db->createCommand()->addCommentOnTable($table, $comment)->execute();
        echo ' done (time: ' . sprintf('%.3f', microtime(true) - $time) . "s)\n";
    }

Usage Example

Beispiel #1
0
 /**
  * @inheritdoc
  * Note: table will be auto pefixied if [[$autoWrapTableNames]] is true.
  * @since 0.3.0
  */
 public function addCommentOnTable($table, $comment)
 {
     $table = $this->autoWrappedTableName($table);
     return parent::addCommentOnTable($table, $comment);
 }