Removing specific staff action logs using the console

Continued from: Don't log all post edits in staff action logs for a user-merge - #4 by JammyDodger

Thanks. In the interim, if a rails console guru can suggest a command to delete system post edit logs for a specified date, that will be helpful to clean the logs.

I think you’ll get more nibbles if this is a separate topic, so I’ve split it off. :+1:

They’re stored in the user_histories table, if that helps you kickstart it?

2 Likes

I thought it would be something like:

UserHistory.where(“created_at > ?”, date).where( and staffuser=xyz, and action=edit post).destroy_all

but with the proper syntax :stuck_out_tongue:

If it is just in the table, it is probably easier just to delete them from postgres directly.

From memory, it’s:

UserHistory.where(bla,bla,bla)

Introduce a way to also permanently delete the sensitive info from the staff logs - #2 by JammyDodger

Though there are some other bits in Administrative Bulk Operations that may help you fill in the bla bla bla

(I’m not at my computer at the minute)

1 Like