1 field_sql_storage.module | field_sql_storage_field_update_forbid($field, $prior_field, $has_data) |
Implements hook_field_update_forbid().
Forbid any field update that changes column definitions if there is any data.
File
- core/
modules/ field/ modules/ field_sql_storage/ field_sql_storage.module, line 256 - Default implementation of the field storage API.
Code
function field_sql_storage_field_update_forbid($field, $prior_field, $has_data) {
if ($has_data && $field['columns'] != $prior_field['columns']) {
throw new FieldUpdateForbiddenException("field_sql_storage cannot change the schema for an existing field with data.");
}
}