Index: modules/field/field.api.php =================================================================== RCS file: /cvs/drupal/drupal/modules/field/field.api.php,v retrieving revision 1.61 diff -u -p -r1.61 field.api.php --- modules/field/field.api.php 13 Jan 2010 04:37:03 -0000 1.61 +++ modules/field/field.api.php 22 Jan 2010 07:05:04 -0000 @@ -78,6 +78,7 @@ function hook_field_extra_fields() { * @see hook_field_info(). * @see hook_field_info_alter(). * @see hook_field_schema(). + * @see hook_field_schema_alter(). * @see hook_field_load(). * @see hook_field_validate(). * @see hook_field_presave(). @@ -239,6 +240,17 @@ function hook_field_schema($field) { } /** + * Allows modules to alter the schema for a field. + * + * @param $schema + * The schema definition as returned by hook_field_schema(). + * @param $field + * The field definition. + */ +function hook_schema_alter($schema, $field) { +} + +/** * Defines custom load behavior for this module's field types. * * Unlike most other field hooks, this hook operates on multiple objects. The Index: modules/field/field.crud.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/field/field.crud.inc,v retrieving revision 1.46 diff -u -p -r1.46 field.crud.inc --- modules/field/field.crud.inc 13 Jan 2010 14:06:46 -0000 1.46 +++ modules/field/field.crud.inc 22 Jan 2010 07:05:05 -0000 @@ -301,7 +301,7 @@ function field_create_field($field) { // Collect storage information. $schema = (array) module_invoke($field['module'], 'field_schema', $field); $schema += array('columns' => array(), 'indexes' => array()); - // 'columns' are hardcoded in the field type. + drupal_alter('field_schema', $schema, $field); $field['columns'] = $schema['columns']; // 'indexes' can be both hardcoded in the field type, and specified in the // incoming $field definition.