LazyRecord\SqlBuilder\PgsqlBuilder::buildColumnSql PHP Method

buildColumnSql() public method

public buildColumnSql ( LazyRecord\Schema\SchemaInterface $schema, DeclareColumn $column )
$schema LazyRecord\Schema\SchemaInterface
$column lazyrecord\schema\DeclareColumn
    public function buildColumnSql(SchemaInterface $schema, DeclareColumn $column)
    {
        $name = $column->name;
        $isa = $column->isa ?: 'str';
        if (!$column->type && $isa == 'str') {
            $column->type = 'text';
        }
        // Note that pgsql doesn't support unsigned integer primary key column
        if ($column->autoIncrement) {
            $column->unsigned = false;
        }
        $args = new ArgumentArray();
        $sql = $column->buildDefinitionSql($this->driver, $args);
        return $sql;
    }