How to remove admin logs

Rails 콘솔을 사용하여 수행할 수 있지만, 위험할 수도 있습니다. 제 생각이 맞다면 다음과 같은 방식으로 진행해야 합니다.

cd /var/discourse
sudo ./launcher enter app
rails c

이제 콘솔에 진입한 상태입니다. 스태프 액션/관리자 로그 전체를 삭제하는 방법 중 하나는 다음을 사용하는 것입니다:

하지만 이는 모든 것을 삭제하므로 원치 않는 결과를 초래할 수 있습니다. 시간 범위를 제한하거나 특정 액션을 조사하는 것이 더 적합할 수 있습니다.

예를 들어:
UserHistory.where(action: 17, acting_user_id: 5)

이것은 ID가 5인 사용자가 삭제한 모든 게시글을 반환합니다.

또는

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

이것은 ID가 15643인 게시글을 누가 삭제했는지에 대한 정보를 반환합니다.

테이블 필드 및 액션 ID 목록은 이 파일을 참고하세요:

# == 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)
#