How to clean deleted fields from your Database

Mar
2016
21

Sometimes, we start building content types with cutom fields through the old mighty CCK module, only to find out later that there is a different need or better approach for the specific field and we need to delete and recreate it. This is fine, since we are just in the development mode and i believe it is something that any developer who have used drupal back office faced this akward situation. The question that comes up afterwards it this "How do i clean the deleted file-s from the Database?" We call for once more Drush to the rescue!

$ drush eval "field_purge_batch(500)"

you might have to run a few times, or increase the $batch_size then there might still be field_deleted and field_deleted_revision tables, even after running cron

query

SELECT * FROM `field_config` WHERE `deleted` = 1
SELECT * FROM `field_config_instance` WHERE `deleted` = 1

if you come up empty, you can safely delete those leftover tables

url: http://drupal.stackexchange.com/questions/38328/clean-deleted-field-from...

Cats: 
this is an arrow pointing back to the top of the page