I am running TT-RSS since a long time. I finally decided I wanted to clean up the database as its getting rather large.
The purge functionality is too broad for me, as I only want to delete entries from certain categories (junk). Hence I wanted to delete manually via SQL and had to look into the code how deletion/purging is handled there.
The purge_feed function in functions.php seems to be the only place that is taking care of deleting feed entries. Unfortunately it only deletes entries from ttrss_user_entries and ttrss_entries (see functions.php, line 272 / 256).
Looking through the database I can also see the following tables:
ttrss_enclosures
ttrss_archived_feeds
I’m not sure about ttrss_archived_feeds, but ttrss_enclosures definitely has a link to post_id (hence the entries table). ttrss_enclosures is never cleaned up anywhere. Shouldn’t it be cleaned up as well?
I also couldn’t find any cleanup job cleaning up ttrss_archived_feeds, I suppose the rule is that if no entry exists anymore for archived_feed with the ID = 1, it should also delete the archived_feed entry, shouldn’t it?
Full deletion SQL:
DELETE ttrss_user_entries, ttrss_entries FROM ttrss_entries
INNER JOIN ttrss_user_entries
ON ttrss_entries.id = ttrss_user_entries.ref_id
INNER JOIN ttrss_feeds
ON ttrss_user_entries.feed_id = ttrss_feeds.id
INNER JOIN ttrss_feed_categories
ON ttrss_feeds.cat_id = ttrss_feed_categories.id
WHERE ttrss_user_entries.marked = false #Add the category id that should be deleted from (SELECT id, title FROM ttrss_feed_categories)
AND ttrss_feed_categories.title = ‘News’ #Everything before this date will be deleted
AND ttrss_entries.date_updated < ‘2013-04-08 11:17:37’
I wasn’t trying to be spoonfed, I thought I found a genuine bug/improvement. Of course I searched before, but after looking through a couple of posts didn’t find what I’m looking for. I guess I didn’t find a bug.
Also hoarding sounds very negative… I use the archive in TT very often to find old tidbits of information and am very happy with it.