2 * Implements hook_field_storage_delete_field().
4 function {{ machine_name }}_field_storage_delete_field($field) {
5 // Mark all data associated with the field for deletion.
7 $table = _field_sql_storage_tablename($field);
8 $revision_table = _field_sql_storage_revision_tablename($field);
10 ->fields(array('deleted' => 1))
13 // Move the table to a unique name while the table contents are being deleted.
14 $field['deleted'] = 1;
15 $new_table = _field_sql_storage_tablename($field);
16 $revision_new_table = _field_sql_storage_revision_tablename($field);
17 db_rename_table($table, $new_table);
18 db_rename_table($revision_table, $revision_new_table);
19 drupal_get_schema(NULL, TRUE);