Question

I installed a module that left a ghost field that isn't tied to any entity bundle :(

How would I go about safely and thoroughly deleting this field from the database?

I have to delete this field to uninstall the module. I have attempted to run cron and clear cache to see if that would remove the field (it does not).

MYSQL command: show tables like '%<string in field>%'; only produces one result (the field I want to delete). Do I just drop that table?

I am using Drush 9.x, so unfortunately it looks like drush field-delete is not available. Is there a way to do this with Drush 9 or Drupal Console?

Thanks in advance for your help!

Was it helpful?

Solution

In Drupal 8 bundle fields are configuration. This looks like you still have the field storage configured.

In this case export configuration:

drush cex

remove the field storage:

rm field.storage.node.field_example.yml

and import configuration again:

drush cim
Licensed under: CC-BY-SA with attribution
Not affiliated with drupal.stackexchange
scroll top