How to remove admin logs

يمكنك القيام بذلك باستخدام وحدة تحكم Rails ولكنها خطيرة أيضًا. لذا إذا كنت على حق، فسيكون الأمر كالتالي:
cd /var/discourse

sudo ./launcher enter app

rails c

الآن أنت في وحدة التحكم، أحد الخيارات لحذف جميع سجلات إجراءات الموظفين / المسؤولين هو استخدام هذا:

ومع ذلك، هذا يزيل كل شيء وقد لا يكون هذا ما تريده. قد ترغب في تحديد الفترة الزمنية أو التحقيق في إجراءات معينة.

على سبيل المثال:
UserHistory.where(action: 17, acting_user_id: 5)

سيؤدي هذا إلى إرجاع جميع المشاركات التي حذفها المستخدم الذي رقمه 5.

أو

UserHistory.where(action: 17, post_id: 15643)

سيؤدي هذا إلى إرجاع معلومات حول من قام بحذف المنشور بالمعرف 15643.

للحصول على قائمة بحقول الجدول ومعرفات الإجراءات، انظر هذا الملف:

# == Schema Information
#
# Table name: user_histories
#
#  id             :integer          not null, primary key
#  action         :integer          not null
#  acting_user_id :integer
#  target_user_id :integer
#  details        :text
#  created_at     :datetime         not null
#  updated_at     :datetime         not null
#  context        :string
#  ip_address     :string
#  email          :string
#  subject        :text
#  previous_value :text
#  new_value      :text
#  topic_id       :integer
#  admin_only     :boolean          default(FALSE)
#  post_id        :integer
#  custom_type    :string
#  category_id    :integer
#
# Indexes
#
#  index_user_histories_on_acting_user_id_and_action_and_id        (acting_user_id,action,id)
#  index_user_histories_on_action_and_id                           (action,id)
#  index_user_histories_on_category_id                             (category_id)
#  index_user_histories_on_subject_and_id                          (subject,id)
#  index_user_histories_on_target_user_id_and_id                   (target_user_id,id)
#  index_user_histories_on_topic_id_and_target_user_id_and_action  (topic_id,target_user_id,action)
#