postgres deprecated
class postgres extends doctrine
deprecated
Database Tools for handling cross-db actions such as altering columns, etc.
Currently not supported is returning SQL for creating tables.
Methods
Database tools constructors.
Check whether a specified column exist in a table
List all of the indices that belong to a table
Check if a specified index exists in table. Does not return PRIMARY KEY and UNIQUE indexes.
Check if a specified index exists in table.
Handle passed database update array.
Create SQL Table
Add new column
Change column type (not name!)
Add index
Add unique index
Add primary key
Returns an array of indices for either unique and primary keys, or simple indices.
Returns whether an asset name exists in a list of assets (case insensitive).
Alter the current database representation using a callback and execute the changes.
Perform schema changes
Update the schema representation with a new table.
No description
No description
No description
No description
No description
No description
No description
No description
No description
Recreate an index of a table
Details
in
doctrine at line 58
__construct(Connection $connection, bool $return_statements = false)
Database tools constructors.
in
doctrine at line 69
protected AbstractSchemaManager
get_schema_manager()
No description
in
doctrine at line 84
protected Schema
get_schema()
No description
in
doctrine at line 92
array
sql_list_tables()
Gets a list of tables in the database.
in
doctrine at line 108
bool
sql_table_exists(string $table_name)
Check if table exists
in
doctrine at line 123
array
sql_list_columns(string $table_name)
Gets a list of columns of a table.
in
doctrine at line 138
bool
sql_column_exists(string $table_name, string $column_name)
Check whether a specified column exist in a table
in
doctrine at line 153
array
sql_list_index(string $table_name)
List all of the indices that belong to a table
NOTE: does not list
- UNIQUE indices
- PRIMARY keys
in
doctrine at line 161
bool
sql_index_exists(string $table_name, string $index_name)
Check if a specified index exists in table. Does not return PRIMARY KEY and UNIQUE indexes.
in
doctrine at line 169
bool|string[]
sql_unique_index_exists(string $table_name, string $index_name)
Check if a specified index exists in table.
NOTE: Does not return normal and PRIMARY KEY indexes
in
doctrine at line 177
bool|string[]
perform_schema_changes(array $schema_changes)
Handle passed database update array.
Expected structure... Key being one of the following drop_tables: Drop tables add_tables: Add tables change_columns: Column changes (only type, not name) add_columns: Add columns to a table drop_keys: Dropping keys drop_columns: Removing/Dropping columns add_primary_keys: adding primary keys add_unique_index: adding an unique index add_index: adding an index (can be column:index_size if you need to provide size)
The values are in this format: {TABLE NAME} => array( {COLUMN NAME} => array({COLUMN TYPE}, {DEFAULT VALUE}, {OPTIONAL VARIABLES}), {KEY/INDEX NAME} => array({COLUMN NAMES}), )
in
doctrine at line 195
bool|string[]
sql_create_table(string $table_name, array $table_data)
Create SQL Table
in
doctrine at line 208
bool|string[]
sql_table_drop(string $table_name)
Drop Table
in
doctrine at line 221
bool|string[]
sql_column_add(string $table_name, string $column_name, array $column_data)
Add new column
in
doctrine at line 234
bool|string[]
sql_column_change(string $table_name, string $column_name, array $column_data)
Change column type (not name!)
in
doctrine at line 280
bool|string[]
sql_column_remove(string $table_name, string $column_name)
Drop column
in
doctrine at line 317
bool|string[]
sql_create_index(string $table_name, string $index_name, string|array $column)
Add index
in
doctrine at line 330
bool|string[]
sql_index_drop(string $table_name, string $index_name)
Drop Index
in
doctrine at line 343
bool|string[]
sql_create_unique_index(string $table_name, string $index_name, string|array $column)
Add unique index
in
doctrine at line 356
bool|string[]
sql_create_primary_key(string $table_name, string|array $column)
Add primary key
in
doctrine at line 374
protected array
get_filtered_index_list(string $table_name, bool $is_non_unique)
Returns an array of indices for either unique and primary keys, or simple indices.
in
doctrine at line 406
protected array
get_asset_names(array $assets)
Returns an array of lowercase asset names.
in
doctrine at line 425
protected bool
asset_exists(string $needle, array $assets)
Returns whether an asset name exists in a list of assets (case insensitive).
in
doctrine at line 438
protected bool|string[]
alter_schema(callable $callback)
Alter the current database representation using a callback and execute the changes.
Returns false in case of error.
in
doctrine at line 477
protected void
alter_table(Schema $schema, string $table_name, callable $callback)
Alter table.
in
doctrine at line 489
protected void
schema_perform_changes(Schema $schema, array $schema_changes)
Perform schema changes
in
doctrine at line 583
protected void
schema_create_table(Schema $schema, string $table_name, array $table_data, bool $safe_check = false)
Update the schema representation with a new table.
Returns null in case of errors
in
doctrine at line 654
protected void
schema_drop_table(Schema $schema, string $table_name, bool $safe_check = false)
No description
in
doctrine at line 673
protected void
schema_column_add(Schema $schema, string $table_name, string $column_name, array $column_data, bool $safe_check = false)
No description
in
doctrine at line 703
protected void
schema_column_change(Schema $schema, string $table_name, string $column_name, array $column_data, bool $safe_check = false)
No description
in
doctrine at line 733
protected void
schema_column_change_add(Schema $schema, string $table_name, string $column_name, array $column_data, bool $safe_check = false)
No description
in
doctrine at line 754
protected void
schema_column_remove(Schema $schema, string $table_name, string $column_name, bool $safe_check = false)
No description
in
doctrine at line 807
protected void
schema_create_index($column, Schema $schema, string $table_name, string $index_name, bool $safe_check = false)
No description
in
doctrine at line 829
protected void
schema_create_unique_index($column, Schema $schema, string $table_name, string $index_name, bool $safe_check = false)
No description
in
doctrine at line 850
protected void
schema_index_drop(Schema $schema, string $table_name, string $index_name, bool $safe_check = false)
No description
in
doctrine at line 870
protected void
schema_create_primary_key(Schema $schema, $column, string $table_name, bool $safe_check = false)
No description
in
doctrine at line 887
protected void
recreate_index(Table $table, Index $index, array $new_columns)
Recreate an index of a table