Inicio › API reference ›
hook_schema_alter
hooks/core.php, line 691
- Versions
- hooks
hook_schema_alter(&$schema)
Perform alterations to existing database schemas.
When a module modifies the database structure of another module (by changing, adding or removing fields, keys or indexes), it should implement hook_schema_alter() to update the default $schema to take it's changes into account.
See hook_schema() for details on the schema definition structure.
Parameters
$schema Nested array describing the schemas for all modules.
Valor de retorno
None.
Código
<?php
function hook_schema_alter(&$schema) {
// Add field to existing schema.
$schema['users']['fields']['timezone_id'] = array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => t('Per-user timezone configuration.'),
);
}
?> 
Comentarios recientes
hace 17 horas 50 mins
hace 1 día 10 horas
hace 1 semana 21 horas
hace 14 semanas 4 días
hace 19 semanas 19 horas
hace 20 semanas 2 días
hace 20 semanas 5 días
hace 20 semanas 5 días
hace 21 semanas 2 días
hace 22 semanas 1 día