How to rest multiple topics bump date
AI-generated summary
The discussion revolves around the need for a way to reset the bump date of multiple topics at once in Discourse. livc explains that their bot updates topics from RSS feeds, causing them to be bumped, and they’d prefer a bulk reset option. Mittineague suggests that while the web UI doesn’t support bulk reset, it could be achieved via the CLI or direct database manipulation, noting the bumped_at field in the Topics table. jamesmarkcook and nathank echo the need, as they’ve also encountered issues where reorganizing forum content bumped old posts, requiring manual resets. The conversation highlights a gap in functionality for bulk operations, with potential solutions involving database queries or Rails console commands.
I don’t know what the use case is, but it seems to me, as far as with using the web UI, it would be easy enough to reset the bump date of individual topics when they were bumped. I’m not seeing how “bulk bump date reset” would ever be needed let alone a common enough need for it to need to have a UI.
Anyway, if you’ve somehow managed to get in a situation where you want to work in bulk, it should be possible to do using the CLI
Thanks for the reply.
I use a bot to fetch RSS blog/Podcast to Discourse, when the feed changed, the topics will be updated automatically and bump up. I have to reset one by one so I think it’s should be better if I can bulk reset.
What do you means CLI? Bulk reset via the database? Thanks.
I was looking for this feature just now.
It’s needed because I was tidying and re-arranging things on my forum, and a load of old posts got bumped to the top. Now I have to go into each one and reset the bump date.
https://github.com/discourse/discourse/blob/master/app/models/topic.rb
If, repeat, if I’ve read it correctly the Topics table has a bumped_at field that is a datetime, not null, its initial not null value is the created_at not null value. AFAIK, the datetime is whatever Ruby now gets.
I think if you determine as best as you can
- what there was immediately prior
- what exactly you did
- what you want to accomplish
there will be a good chance you can put together a query. How many is a “load”? If it’s a one-time it might be better to just slog it out.
(Unfortunately there is no “prior_to_bump_date” field
)
Me too!
How does one reset the bump date manually from the rails console? Revert bumped_at to the updated_at for the topics in question?