function field_test_schema_alter_field_schema_alter

Implements hook_field_schema_alter().

File

modules/field/tests/field_test_schema_alter.install, line 11

Code

function field_test_schema_alter_field_schema_alter(&$schema, $field) {
    if ($field['type'] == 'test_field') {
        // Alter the field type.
        $schema['columns']['value']['type'] = 'float';
        // Add an additional column of data.
        $schema['columns']['additional_column'] = array(
            'description' => "Additional column added to image field table.",
            'type' => 'varchar',
            'length' => 128,
            'not null' => FALSE,
        );
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.