framework/db/Migration.php
public function createTable($table, $columns, $options = null)
    {
        $time = $this->beginCommand("create table $table");
        $this->db->createCommand()->createTable($table, $columns, $options)->execute();
        foreach ($columns as $column => $type) {
            if ($type instanceof ColumnSchemaBuilder && $type->comment !== null) {
                $this->db->createCommand()->addCommentOnColumn($table, $column, $type->comment)->execute();
            }
        }
        $this->endCommand($time);
    }
public function createTable($table, $columns, $options = null)
    {
        $time = $this->beginCommand("create table $table");
        $this->db->createCommand()->createTable($table, $columns, $options)->execute();
        foreach ($columns as $column => $type) {
            if ($type instanceof ColumnSchemaBuilder && $type->comment !== null) {
                $this->db->createCommand()->addCommentOnColumn($table, $column, $type->comment)->execute();
            }
        }
        $this->endCommand($time);
    }
public function createTable ( $ table , $ columns , $ options = null ) { $ time = $ this -> beginCommand ( "create table $table" ) ; $ this -> db -> createCommand ( ) -> createTable ( $ table , $ columns , $ options ) -> execute ( ) ; foreach ( $ columns as $ column => $ type ) { if ( $ type instanceof ColumnSchemaBuilder && $ type -> comment !== null ) { $ this -> db -> createCommand ( ) -> addCommentOnColumn ( $ table , $ column , $ type -> comment ) -> execute ( ) ; } } $ this -> endCommand ( $ time ) ; }
Builds and executes a SQL statement for creating a new DB table.

The columns in the new  table should be specified as name-definition pairs (e.g. 'name' => 'string'),
where name stands for a column name which will be properly quoted by the method, and definition
stands for the column type which can contain an abstract DB type.

The [[QueryBuilder::getColumnType()]] method will be invoked to convert any abstract type into a physical one.

If a column is specified with definition only (e.g. 'PRIMARY KEY (name, type)'), it will be directly
put into the generated SQL.

@param string $table the name of the table to be created. The name will be properly quoted by the method.
@param array $columns the columns (name => definition) in the new table.
@param string $options additional SQL fragment that will be appended to the generated SQL.
Builds and executes a SQL statement for creating a new DB table .