function hook_schema_alter

×

Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
cis7 system.api.php hook_schema_alter(&$schema)
cle7 system.api.php hook_schema_alter(&$schema)
elmsmedia7 system.api.php hook_schema_alter(&$schema)
icor7 system.api.php hook_schema_alter(&$schema)
meedjum_blog7 system.api.php hook_schema_alter(&$schema)
mooc7 system.api.php 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 its changes into account.

See hook_schema() for details on the schema definition structure.

Parameters

$schema: Nested array describing the schemas for all modules.

Related topics

8 functions implement hook_schema_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

data_schema_alter in sites/all/modules/local_contrib/data/data.install
Implements hook_schema_alter().
ds_extras_schema_alter in sites/all/modules/ulmus/ds/modules/ds_extras/ds_extras.install
Implements hook_schema_alter().
filefield_paths_schema_alter in sites/all/modules/ulmus/filefield_paths/filefield_paths.install
Implements hook_schema_alter().
file_entity_schema_alter in sites/all/modules/ulmus/file_entity/file_entity.install
Implements hook_schema_alter().
lti_tool_provider_outcomes_schema_alter in sites/all/modules/ulmus/lti_tool_provider/lti_tool_provider_outcomes/lti_tool_provider_outcomes.install
Implements hook_schema_alter().

... See full list

1 invocation of hook_schema_alter()
drupal_get_complete_schema in includes/bootstrap.inc
Gets the whole database schema.

File

modules/system/system.api.php, line 3204
Hooks provided by Drupal core and the System module.

Code

function hook_schema_alter(&$schema) {
  // Add field to existing schema.
  $schema['users']['fields']['timezone_id'] = array(
    'type' => 'int',
    'not null' => TRUE,
    'default' => 0,
    'description' => 'Per-user timezone configuration.',
  );
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.