Come ripristinare la data di aggiornamento di più argomenti

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.

Stavo cercando proprio questa funzione.

È necessaria perché stavo riordinando e riorganizzando le cose nel mio forum, e un sacco di vecchi post sono stati rimessi in cima. Ora devo entrare in ognuno di essi e reimpostare la data di rimbalzo.

https://github.com/discourse/discourse/blob/master/app/models/topic.rb

Se, ripeto, se ho letto correttamente, la tabella Topics ha un campo bumped_at di tipo datetime, non nullo; il suo valore iniziale non nullo è il valore non nullo di created_at. Per quanto ne so, il datetime è quello restituito da now di Ruby.

Penso che, se riesci a determinare al meglio possibile:

  • cosa c’era immediatamente prima
  • cosa hai fatto esattamente
  • cosa vuoi ottenere

ci saranno buone probabilità di riuscire a costruire una query. Quanti sono un “carico”? Se si tratta di un’operazione una tantum, potrebbe essere meglio affrontarla manualmente.

(Sfortunatamente non esiste un campo “prior_to_bump_date” :sadpanda:)

Anche io!

Come si reimposta manualmente la data di “bump” dalla console Rails? Riportare bumped_at a updated_at per gli argomenti in questione?