Utility function: delete an instance and all its data of a field stored in SQL Storage.
BEWARE: this function deletes user data from the field storage tables.
This function is valid for a database schema version 7000.
function _update_7000_field_delete_instance($field_name, $entity_type, $bundle) {
// Delete field instance configuration data.
db_delete('field_config_instance')
->condition('field_name', $field_name)
->condition('entity_type', $entity_type)
->condition('bundle', $bundle)
->execute();
// Nuke data.
db_delete('field_data_' . $field_name)
->condition('entity_type', $entity_type)
->condition('bundle', $bundle)
->execute();
db_delete('field_revision_' . $field_name)
->condition('entity_type', $entity_type)
->condition('bundle', $bundle)
->execute();
}