function hook_schema_field_type_map_alter in Schema 7
Same name and namespace in other branches
- 8 schema.api.php \hook_schema_field_type_map_alter()
Alter the results from the getFieldTypeMap() methods in the schema class.
Parameters
array $map: The array mapping of Drupal schema field names to DB-native field types.
DatabaseSchema $schema: The database schema class.
DatabaseConnection $connection: The database connection class since the $schema object doesn't offer $schema->connection as a public property.
1 function implements hook_schema_field_type_map_alter()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- field_schema_field_type_map_alter in ./
schema.module - Implements hook_schema_field_type_map_alter() on behalf of field.module.
2 invocations of hook_schema_field_type_map_alter()
- SchemaDatabaseSchema_mysql::getFieldTypeMap in engines/
mysql.inc - Overrides DatabaseSchema_mysql::getFieldTypeMap().
- SchemaDatabaseSchema_pgsql::getFieldTypeMap in engines/
pgsql.inc - Overrides DatabaseSchema_pgsql::getFieldTypeMap().
File
- ./
schema.api.php, line 19 - API integration for the Schema module.
Code
function hook_schema_field_type_map_alter(array &$map, DatabaseSchema $schema, DatabaseConnection $connection) {
switch ($connection
->getType()) {
case 'mysql':
$map['datetime:normal'] = 'DATETIME';
break;
case 'pgsql':
$map['datetime:normal'] = 'timestamp without time zone';
break;
case 'sqlite':
$map['datetime:normal'] = 'VARCHAR';
break;
}
}