Closed (works as designed)
Project:
Field API helper
Version:
7.x-1.1
Component:
Code
Priority:
Critical
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
14 Aug 2012 at 10:17 UTC
Updated:
25 Sep 2013 at 20:03 UTC
Hi,
When deleting fields of a custom content type, I am getting the following tables left out in the database:
field_deleted_data_147
field_deleted_data_160
field_deleted_data_167
and many more such tables.
I can delete these tables by running SQL query but isnt there a way in Drupal to perform the task automatically i.e. these tables should be deleted automatically when you delete a field?
I think field_purge_batch could do the job but dont know how.
Any help out there?
Thanks in advance,
Ashok Negi
Comments
Comment #1
pyry_p commentedI had the same problem. The cron didnt seem to do nothing with my 100 deleted_data and and 100 deleted_revisions tables. Problem with relying on field_purge_batch as part of normal cron execution is that it has lower limit (i think it was 5?). After running purge as separate call with limit of 50 (execution time ~200 secs) and counting all the rows of deleted tables in between, I was able to verify that everything was working. Row count decreased by 5400 on each purge and after awhile even 4 tables got dropped. Now im fairly certain that fields are not hanging for some mystical dependency. Current decision is should i just delete the tables form database and clear the related rows from field_config and field_config_instance or run the purge function repeatedly for 1 day to get rid of all ~1800 000 rows and 100 tables correctly.
Rough code in custom module
Comment #2
geerlingguy commentedThose tables will eventually be cleared by field_purge_batch; after about six hours (I think), cron runs will begin clearing out the tables. Things are done this way to avoid causing the actual field deletion operation to take too long.
If you want to clear them out sooner, make sure you delete the table itself, then delete the corresponding (now expired) records from
{field_config}and{field_config_instance}(they should be marked with'deleted' = 0—that's how the field module knows to delete them after a certain amount of time).Comment #3
kenheim commentedOr you could just run cron manually. That took care of it for me.
Comment #4
jeremyclassic commentedDon't mean to dig up an old post, but this statement is wrong:
Items awaiting deletion are marked
'deleted'=1.Comment #5
aangel commentedRunning cron wasn't deleting the tables for me. On closer inspection, there was an entry in field_config_instance marked for deletion but I had inadvertently deleted it manually before I had understood this whole process. Removing that entry allowed the purge process to proceed normally. (It was stopping with an exception when it couldn't find the table that was supposed to be there.)