CRM_Core_BAO_SchemaHandler
class CRM_Core_BAO_SchemaHandler
This file contains functions for creating and altering CiviCRM-tables structure.
$table = array( 'name' => TABLE_NAME, 'attributes' => ATTRIBUTES, 'fields' => array( array( 'name' => FIELD_NAME, // can be field, index, constraint 'type' => FIELD_SQL_TYPE, 'class' => FIELD_CLASS_TYPE, 'primary' => BOOLEAN, 'required' => BOOLEAN, 'searchable' => TRUE, 'fk_table_name' => FOREIGN_KEY_TABLE_NAME, 'fk_field_name' => FOREIGN_KEY_FIELD_NAME, 'comment' => COMMENT, 'default' => DEFAULT, ) ... ));
Methods
Create a CiviCRM-table
No description
No description
No description
No description
No description
No description
No description
No description
Delete a CiviCRM-table.
No description
No description
Create indexes.
Get indexes for tables
Drop an index if one by that name exists.
No description
Check if the table has an index matching the name.
Check if the table has a specified column.
Check if a foreign key Exists
Remove a foreign key from a table if it exists.
Add index signature hash to DAO file calculation.
Compare the indices specified in the XML files with those in the DB.
Create missing indices.
Details
at line 67
static bool
createTable(array $params)
Create a CiviCRM-table
at line 91
static string
buildTableSQL(array $params)
at line 128
static string
buildFieldSQL(array $params, $separator, $prefix)
at line 163
static NULL|string
buildPrimaryKeySQL(array $params, $separator, $prefix)
at line 182
static NULL|string
buildSearchIndexSQL(array $params, $separator, $prefix, bool $indexExist = FALSE)
at line 214
static string
buildIndexSQL(array $params, $separator, $prefix)
at line 246
static bool
changeFKConstraint(string $tableName, string $fkTableName)
at line 276
static NULL|string
buildForeignKeySQL(array $params, $separator, $prefix, string $tableName)
at line 300
static bool
alterFieldSQL(array $params, bool $indexExist = FALSE, bool $triggerRebuild = TRUE)
at line 365
static
dropTable(string $tableName)
Delete a CiviCRM-table.
at line 376
static
dropColumn(string $tableName, string $columnName, bool $l18n = FALSE)
at line 398
static
changeUniqueToIndex(string $tableName, bool $dropUnique = TRUE)
at line 433
static
createIndexes($tables, string $createIndexPrefix = 'index', array $substrLengths = array())
Create indexes.
at line 516
static array('tableName'
getIndexes(array $tables)
Get indexes for tables
at line 541
static
dropIndexIfExists(string $tableName, string $indexName)
Drop an index if one by that name exists.
at line 555
static
alterFieldLength(int $customFieldID, string $tableName, string $columnName, $length)
at line 612
static bool
checkIfIndexExists(string $tableName, array $indexName)
Check if the table has an index matching the name.
at line 631
static bool
checkIfFieldExists(string $tableName, string $columnName)
Check if the table has a specified column.
at line 648
static bool
checkFKExists(string $table_name, string $constraint_name)
Check if a foreign key Exists
at line 679
static bool
safeRemoveFK($table_name, $constraint_name)
Remove a foreign key from a table if it exists.
at line 693
static
addIndexSignature(string $table, array $indices)
Add index signature hash to DAO file calculation.
at line 707
static array
getMissingIndices()
Compare the indices specified in the XML files with those in the DB.
at line 745
static
createMissingIndices(array $missingIndices)
Create missing indices.