function taxonomy_update_8501 in Drupal 8
Convert the custom taxonomy term hierarchy storage to a default storage.
File
- core/
modules/ taxonomy/ taxonomy.install, line 49 - Install, update and uninstall functions for the taxonomy module.
Code
function taxonomy_update_8501() {
$definition_update_manager = \Drupal::entityDefinitionUpdateManager();
/** @var \Drupal\Core\Field\BaseFieldDefinition $field_storage_definition */
$field_storage_definition = $definition_update_manager
->getFieldStorageDefinition('parent', 'taxonomy_term');
$field_storage_definition
->setCustomStorage(FALSE);
$definition_update_manager
->updateFieldStorageDefinition($field_storage_definition);
}