We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

DB exp_category_posts cleanup

Development and Programming

jledford's avatar
jledford
3 posts
12 years ago
jledford's avatar jledford

I am looking at the relationship between category_posts and channel_data and want to know if category_posts is related to any other tables. I have some data in channel_data to bulk delete/update. When I remove those entries from channel_data it leaves orphaned records in category_posts. Is it safe to delete those orphaned records are does category_posts relate to some other table I am not looking at?

Here is the super simple query I am using to find these nulls

select e.entry_id,c.entry_id from exp_channel_data e right outer JOIN exp_category_posts c ON (e.entry_id = c.entry_id) where e.entry_id is null group by c.entry_id

I wasn’t expecting as many results as I am getting which is why the concern.

I think my question extends to exp_channel_titles and its relationship to channel_data also. If I delete an entry from channel_data do I need to also do cleanup and delete from channel_title?

Thanks for your help.

       
Boyink!'s avatar
Boyink!
5,011 posts
12 years ago
Boyink!'s avatar Boyink!

What I would recommend is turning on the Output Profiler:

Administration System Administration Output and Debugging Preferences Display Output Profiler?

Then publish an entry and note which tables get updated. This will give you some clues about which tables to look at for deleting.

       
jledford's avatar
jledford
3 posts
12 years ago
jledford's avatar jledford

I tried enabling that, I get a green check like it did it successfully but the window comes back to the output settings with that turned off. I took a look at the config.php file and I really don’t see anything referencing that type of setting. Any thoughts?

       
Boyink!'s avatar
Boyink!
5,011 posts
12 years ago
Boyink!'s avatar Boyink!

Is your config file server-editable?

       
jledford's avatar
jledford
3 posts
12 years ago
jledford's avatar jledford

sorry for the late reply. Yes my config file is server editable and owned by the apache user. On my test server the www directory is a mounted drive and on my other servers its a mounted nfs server. I am having the issue in all locations. Let me know what you think.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.