All Data Structures Functions Variables Pages
Static Public Member Functions | Data Fields | Static Protected Member Functions
CreateOrUpdateExistingTableFromSchemaDefinitionArrayUtil Class Reference

Static Public Member Functions

static getTableSchema ($tableName, $columns=array(), $indexes=array())
 
static generateOrUpdateTableBySchemaDefinition (array $schemaDefinition, &$messageLogger, $validate=true)
 
static resolveProcessedTables ()
 

Data Fields

const CACHE_KEY = 'CreateOrUpdateExistingTableFromSchemaDefinitionArrayUtil_processedTableNames'
 

Static Protected Member Functions

static validateSchemaDefinition (array $schemaDefinition)
 
static validateColumnDefinitionsFromSchema (array $columns)
 
static validateIndexDefinitionsFromSchema (array $indexes, array $columns)
 
static resolveAlterQueryForColumn ($column)
 
static resolveColumnUpgradeQueries ($columns, $existingFields)
 
static doesIndexNeedUpgrade ($indexMetadata, $existingIndexes)
 
static resolveIndexUpgradeQueries ($indexes, $existingIndexes)
 
static resolveAlterTableQuery ($tableName, $columnsAndIndexes, $existingFields, $existingIndexes)
 
static resolveColumnUpgradeDefinition ($column, $existingFields)
 
static doesColumnNeedUpgrade ($column, $existingField)
 
static isColumnTypeSameAsExistingFieldOrSmaller ($column, $existingField)
 
static isColumnLengthShrinkOrConversionToUnsigned ($columnLength, $fieldLength, $columnUnsigned, $fieldUnsigned)
 
static isColumnTypeSmallerThanExistingFieldType ($columnType, $fieldType)
 
static resolveExistingFieldTypeAndLengthAndUsigned (array $existingField)
 
static resolveColumnTypeAndLength ($columnTypeAndLength)
 
static isColumnTypeSameAsExistingField ($column, $existingField)
 
static isColumnNullSameAsExistingField ($column, $existingField)
 
static isColumnDefaultValueSameAsExistingField ($column, $existingField)
 
static resolveCreateTableQuery ($tableName, $columnsAndIndexesSchema)
 
static resolveColumnStatementFromDefinition ($column, $isAddition=true)
 
static resolveIndexStatementCreation ($indexName, $indexMetadata, $alterTable=false)
 
static returnSchemaValidationResult ($message, $isValid=false)
 

Detailed Description

Utility to generate or update a table in database when provided with a database schema in array format

Definition at line 40 of file CreateOrUpdateExistingTableFromSchemaDefinitionArrayUtil.php.

Member Function Documentation

static getTableSchema (   $tableName,
  $columns = array(),
  $indexes = array() 
)
static

Returns table schema definition

Parameters
$tableName
array$columns
array$indexes
Returns
array $schema

Definition at line 51 of file CreateOrUpdateExistingTableFromSchemaDefinitionArrayUtil.php.

static generateOrUpdateTableBySchemaDefinition ( array  $schemaDefinition,
$messageLogger,
  $validate = true 
)
static

Provide a schema definition array queries to create/update database schema are executed.

Parameters
array$schemaDefinition
$messageLogger
$validate
Exceptions
CException
Exception|RedBean_Exception_SQL

Definition at line 70 of file CreateOrUpdateExistingTableFromSchemaDefinitionArrayUtil.php.

static resolveProcessedTables ( )
static

Returns an array of processed tables.

Returns
array

Definition at line 136 of file CreateOrUpdateExistingTableFromSchemaDefinitionArrayUtil.php.


The documentation for this class was generated from the following file:
Generated on Wed Jun 3 2020 07:10:44