How to rest multiple topics bump date
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.
ちょうど今、この機能を探していました。
私のフォーラムで整理や並べ替えをしていたところ、古い投稿が多数トップに浮上してしまいました。そのため、各投稿にアクセスして、再度「バンプ日付」をリセットする必要があります。
https://github.com/discourse/discourse/blob/master/app/models/topic.rb
もし、繰り返しになりますが、私の読み方が正しければ、Topics テーブルには bumped_at フィールドがあり、これは datetime 型で NULL 値を許容しません。その初期の NOT NULL 値は created_at の NOT NULL 値と同じです。私の知る限り、この datetime は Ruby の now が返す値です。
あなたができるだけ正確に以下を特定すれば、クエリを組み立てられる可能性が高いと思います。
- 直前に何が存在していたか
- 正確に何を操作したか
- 何を達成したいか
「大量」とはどれくらいの数を指すのでしょうか?もし一時的な処理であれば、地道に処理を進めた方がよいかもしれません。
(残念ながら、prior_to_bump_date というフィールドはありません
)
私もです!
レールコンソールから手動で「bump」の日付をリセットするにはどうすればよいですか?問題のトピックの bumped_at を updated_at に戻すのですか?