كيفية إعادة تعيين تاريخ رفع عدة مواضيع

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 ولا يقبل القيم الفارغة (not null)، وقيمته الأولية غير الفارغة هي قيمة created_at غير الفارغة. حسب علمي، فإن قيمة datetime هي ما تُعيده دالة Ruby now.

أعتقد أنه إذا قمتَ بتحديد أفضل ما يمكنك

  • ما الذي كان موجودًا مباشرةً قبل ذلك
  • ما الذي فعلته بالضبط
  • ما الذي ترغب في تحقيقه

فإن هناك فرصة جيدة لأن تتمكن من صياغة استعلام. ما عدد السجلات الذي يُعتبر “حمولة”؟ إذا كانت العملية لمرة واحدة، فقد يكون من الأفضل إنجازها يدويًا.

(للأسف، لا يوجد حقل “prior_to_bump_date” :sadpanda: )

أنا أيضاً!

كيف يمكن للمرء إعادة تعيين تاريخ الدفعة يدوياً من وحدة تحكم rails؟ هل أعيد bumped_at إلى updated_at للمواضيع المعنية؟