DatabaseSchema: ezcDbSchemaOracleWriter
[ ]
[ ]
[ ]
[ ]
[ ]
Class: ezcDbSchemaOracleWriter
|
Handler for storing database schemas and applying differences that uses Oracle as backend. [
source]
Implemented Interfaces
Parents
ezcDbSchemaCommonSqlWriter
|
--ezcDbSchemaOracleWriter
Inherited Member Variables
From
ezcDbSchemaCommonSqlWriter:
Method Summary
|
public void |
applyDiffToDb(
$db, $dbSchemaDiff )
Applies the differences defined in $dbSchemaDiff to the database referenced by $db. |
|
public array(string) |
convertDiffToDDL(
$dbSchemaDiff, $dbSchemaDiff
)
Returns the differences definition in $dbSchema as database specific SQL DDL queries. |
|
protected string |
convertFromGenericType(
$fieldDefinition )
Converts the generic field type contained in $fieldDefinition to a database specific field definition. |
|
protected void |
generateAddFieldSql(
$tableName, $fieldName, $fieldDefinition )
Adds a "alter table" query to add the field $fieldName to $tableName with the definition $fieldDefinition. |
|
protected void |
generateAddIndexSql(
$tableName, $indexName, $indexDefinition )
Adds a "alter table" query to add the index $indexName to the table $tableName with definition $indexDefinition to the internal list of queries |
|
protected void |
generateChangeFieldSql(
$tableName, $fieldName, $fieldDefinition )
Adds a "alter table" query to change the field $fieldName to $tableName with the definition $fieldDefinition. |
|
protected void |
generateCreateTableSql(
$tableName, $tableDefinition )
Adds a "create table" query for the table $tableName with definition $tableDefinition to the internal list of queries. |
|
protected string |
generateDefault(
$type, $value )
Returns an appropriate default value for $type with $value. |
|
protected void |
generateDiffSchemaTableAsSql(
$tableName, $tableDiff )
Generates queries to upgrade a the table $tableName with the differences in $tableDiff. |
|
protected void |
generateDropFieldSql(
$tableName, $fieldName )
Adds a "alter table" query to drop the field $fieldName from $tableName. |
|
protected void |
generateDropIndexSql(
$tableName, $indexName )
Adds a "alter table" query to remote the index $indexName from the table $tableName to the internal list of queries. |
|
protected void |
generateDropTableSql(
$tableName )
Adds a "drop table" query for the table $tableName to the internal list of queries. |
|
protected string |
generateFieldSql(
$fieldName, $fieldDefinition, $autoincrementField )
Returns a column definition for $fieldName with definition $fieldDefinition. |
|
public int |
getDiffWriterType(
)
Returns what type of schema difference writer this class implements. |
|
public boolean |
isQueryAllowed(
$db, $query, $query
)
Checks if query allowed. |
Inherited Methods
From
ezcDbSchemaCommonSqlWriter :
Methods
applyDiffToDb
Applies the differences defined in $dbSchemaDiff to the database referenced by $db.
This method uses
convertDiffToDDL to create SQL for the differences and then executes the returned SQL statements on the database handler $db.
Parameters
convertDiffToDDL
Returns the differences definition in $dbSchema as database specific SQL DDL queries.
Parameters
convertFromGenericType
Converts the generic field type contained in $fieldDefinition to a database specific field definition.
Parameters
generateAddFieldSql
void generateAddFieldSql(
string
$tableName, string
$fieldName,
ezcDbSchemaField
$fieldDefinition )
Adds a "alter table" query to add the field $fieldName to $tableName with the definition $fieldDefinition.
Parameters
| Name |
Type |
Description |
$tableName |
string |
|
$fieldName |
string |
|
$fieldDefinition |
ezcDbSchemaField |
|
Redefinition of
generateAddIndexSql
void generateAddIndexSql(
string
$tableName, string
$indexName,
ezcDbSchemaIndex
$indexDefinition )
Adds a "alter table" query to add the index $indexName to the table $tableName with definition $indexDefinition to the internal list of queries
Parameters
| Name |
Type |
Description |
$tableName |
string |
|
$indexName |
string |
|
$indexDefinition |
ezcDbSchemaIndex |
|
Redefinition of
generateChangeFieldSql
void generateChangeFieldSql(
string
$tableName, string
$fieldName,
ezcDbSchemaField
$fieldDefinition )
Adds a "alter table" query to change the field $fieldName to $tableName with the definition $fieldDefinition.
Parameters
| Name |
Type |
Description |
$tableName |
string |
|
$fieldName |
string |
|
$fieldDefinition |
ezcDbSchemaField |
|
Redefinition of
generateCreateTableSql
void generateCreateTableSql(
string
$tableName,
ezcDbSchemaTable
$tableDefinition )
Adds a "create table" query for the table $tableName with definition $tableDefinition to the internal list of queries.
Adds additional CREATE queries for sequences and triggers to implement autoincrement fields that not supported in Oracle directly.
Parameters
Redefinition of
generateDefault
string generateDefault(
string
$type, mixed
$value )
Returns an appropriate default value for $type with $value.
Parameters
| Name |
Type |
Description |
$type |
string |
|
$value |
mixed |
|
Redefinition of
generateDiffSchemaTableAsSql
Generates queries to upgrade a the table $tableName with the differences in $tableDiff.
This method generates queries to migrate a table to a new version with the changes that are stored in the $tableDiff property. It will call different subfunctions for the different types of changes, and those functions will add queries to the internal list of queries that is stored in $this->queries.
Parameters
Redefinition of
generateDropFieldSql
void generateDropFieldSql(
string
$tableName, string
$fieldName )
Adds a "alter table" query to drop the field $fieldName from $tableName.
Parameters
| Name |
Type |
Description |
$tableName |
string |
|
$fieldName |
string |
|
Redefinition of
generateDropIndexSql
void generateDropIndexSql(
string
$tableName, string
$indexName )
Adds a "alter table" query to remote the index $indexName from the table $tableName to the internal list of queries.
Parameters
| Name |
Type |
Description |
$tableName |
string |
|
$indexName |
string |
|
Redefinition of
generateDropTableSql
void generateDropTableSql(
string
$tableName )
Adds a "drop table" query for the table $tableName to the internal list of queries.
Parameters
| Name |
Type |
Description |
$tableName |
string |
|
Redefinition of
generateFieldSql
string generateFieldSql(
string
$fieldName,
ezcDbSchemaField
$fieldDefinition, string
$autoincrementField )
Returns a column definition for $fieldName with definition $fieldDefinition.
Parameters
| Name |
Type |
Description |
$fieldName |
string |
|
$fieldDefinition |
ezcDbSchemaField |
|
$autoincrementField |
string |
|
Redefinition of
getDiffWriterType
int getDiffWriterType(
)
Returns what type of schema difference writer this class implements.
This method always returns ezcDbSchema::DATABASE
isQueryAllowed
boolean isQueryAllowed(
$db,
$query, string
$query
)
Checks if query allowed.
Perform testing if table exist for DROP TABLE query to avoid stoping execution while try to drop not existent table.
Parameters
Redefinition of
Last updated: Mon, 10 Nov 2008