2 * Implements hook_field_storage_update_field().
4 function {{ machine_name }}_field_storage_update_field($field, $prior_field, $has_data) {
6 // There is no data. Re-create the tables completely.
7 $prior_schema = _field_sql_storage_schema($prior_field);
8 foreach ($prior_schema as $name => $table) {
9 db_drop_table($name, $table);
11 $schema = _field_sql_storage_schema($field);
12 foreach ($schema as $name => $table) {
13 db_create_table($name, $table);
17 // There is data. See field_sql_storage_field_storage_update_field() for
18 // an example of what to do to modify the schema in place, preserving the
19 // old data as much as possible.
21 drupal_get_schema(NULL, TRUE);