yii\db\Command::alterColumn PHP Method

alterColumn() public method

Creates a SQL command for changing the definition of a column.
public alterColumn ( string $table, string $column, string $type )
$table string the table whose column is to be changed. The table name will be properly quoted by the method.
$column string the name of the column to be changed. The name will be properly quoted by the method.
$type string the column type. [[\yii\db\QueryBuilder::getColumnType()]] will be called to convert the give column type to the physical one. For example, `string` will be converted as `varchar(255)`, and `string not null` becomes `varchar(255) not null`.
    public function alterColumn($table, $column, $type)
    {
        $sql = $this->db->getQueryBuilder()->alterColumn($table, $column, $type);
        return $this->setSql($sql)->requireTableSchemaRefresh($table);
    }