PHP Class Cake\Database\Schema\PostgresSchema

Inheritance: extends Cake\Database\Schema\BaseSchema
Show file Open project: cakephp/cakephp Class Usage Examples

Public Methods

Method Description
addConstraintSql ( Cake\Database\Schema\Table $table ) {@inheritDoc}
columnSql ( Cake\Database\Schema\Table $table, $name ) {@inheritDoc}
constraintSql ( Cake\Database\Schema\Table $table, $name ) {@inheritDoc}
convertColumnDescription ( Cake\Database\Schema\Table $table, $row ) {@inheritDoc}
convertForeignKeyDescription ( Cake\Database\Schema\Table $table, $row ) {@inheritDoc}
convertIndexDescription ( Cake\Database\Schema\Table $table, $row ) {@inheritDoc}
createTableSql ( Cake\Database\Schema\Table $table, $columns, $constraints, $indexes ) {@inheritDoc}
describeColumnSql ( $tableName, $config ) {@inheritDoc}
describeForeignKeySql ( $tableName, $config ) {@inheritDoc}
describeIndexSql ( $tableName, $config ) {@inheritDoc}
dropConstraintSql ( Cake\Database\Schema\Table $table ) {@inheritDoc}
dropTableSql ( Cake\Database\Schema\Table $table ) : array Generate the SQL to drop a table.
indexSql ( Cake\Database\Schema\Table $table, $name ) {@inheritDoc}
listTablesSql ( $config ) {@inheritDoc}
truncateTableSql ( Cake\Database\Schema\Table $table ) {@inheritDoc}

Protected Methods

Method Description
_convertColumn ( string $column ) : array Convert a column definition to the abstract types.
_convertConstraint ( Cake\Database\Schema\Table $table, string $name, string $type, array $row ) : void Add/update a constraint into the schema object.
_convertOnClause ( $clause ) {@inheritDoc}
_defaultValue ( string | null $default ) : string | null Manipulate the default value.
_keySql ( string $prefix, array $data ) : string Helper method for generating key SQL snippets.

Method Details

_convertColumn() protected method

The returned type will be a type that Cake\Database\Type can handle.
protected _convertColumn ( string $column ) : array
$column string The column type + length
return array Array of column information.

_convertConstraint() protected method

Add/update a constraint into the schema object.
protected _convertConstraint ( Cake\Database\Schema\Table $table, string $name, string $type, array $row ) : void
$table Cake\Database\Schema\Table The table to update.
$name string The index name.
$type string The index type.
$row array The metadata record to update with.
return void

_convertOnClause() protected method

{@inheritDoc}
protected _convertOnClause ( $clause )

_defaultValue() protected method

Postgres includes sequence data and casting information in default values. We need to remove those.
protected _defaultValue ( string | null $default ) : string | null
$default string | null The default value.
return string | null

_keySql() protected method

Helper method for generating key SQL snippets.
protected _keySql ( string $prefix, array $data ) : string
$prefix string The key prefix
$data array Key data.
return string

addConstraintSql() public method

{@inheritDoc}
public addConstraintSql ( Cake\Database\Schema\Table $table )
$table Cake\Database\Schema\Table

columnSql() public method

{@inheritDoc}
public columnSql ( Cake\Database\Schema\Table $table, $name )
$table Cake\Database\Schema\Table

constraintSql() public method

{@inheritDoc}
public constraintSql ( Cake\Database\Schema\Table $table, $name )
$table Cake\Database\Schema\Table

convertColumnDescription() public method

{@inheritDoc}
public convertColumnDescription ( Cake\Database\Schema\Table $table, $row )
$table Cake\Database\Schema\Table

convertForeignKeyDescription() public method

{@inheritDoc}
public convertForeignKeyDescription ( Cake\Database\Schema\Table $table, $row )
$table Cake\Database\Schema\Table

convertIndexDescription() public method

{@inheritDoc}
public convertIndexDescription ( Cake\Database\Schema\Table $table, $row )
$table Cake\Database\Schema\Table

createTableSql() public method

{@inheritDoc}
public createTableSql ( Cake\Database\Schema\Table $table, $columns, $constraints, $indexes )
$table Cake\Database\Schema\Table

describeColumnSql() public method

{@inheritDoc}
public describeColumnSql ( $tableName, $config )

describeForeignKeySql() public method

{@inheritDoc}
public describeForeignKeySql ( $tableName, $config )

describeIndexSql() public method

{@inheritDoc}
public describeIndexSql ( $tableName, $config )

dropConstraintSql() public method

{@inheritDoc}
public dropConstraintSql ( Cake\Database\Schema\Table $table )
$table Cake\Database\Schema\Table

dropTableSql() public method

Generate the SQL to drop a table.
public dropTableSql ( Cake\Database\Schema\Table $table ) : array
$table Cake\Database\Schema\Table Table instance
return array SQL statements to drop a table.

indexSql() public method

{@inheritDoc}
public indexSql ( Cake\Database\Schema\Table $table, $name )
$table Cake\Database\Schema\Table

listTablesSql() public method

{@inheritDoc}
public listTablesSql ( $config )

truncateTableSql() public method

{@inheritDoc}
public truncateTableSql ( Cake\Database\Schema\Table $table )
$table Cake\Database\Schema\Table