discourse/db/migrate/20241127034553_add_potentially_illegal_to_reviewables.rb
Ted Johansson f4d0a77d5f
DEV: Add "delete user" options to illegal flag review (#29956)
We already add the "delete user" and "delete and block user" options to the drop-down for potential spam, but we should do this for potentially illegal posts as well.

This is entirely based on the implementation for the potential spam one, including caching the status on the reviewable record.

Also note that just as for potential spam, the user must be "deletable" for the option to appear.

I also took the liberty to move the options in the drop-down to what I think is a more intuitive place. (Between delete post and suspend/silence user.)
2024-11-27 17:23:57 +08:00

17 lines
577 B
Ruby

# frozen_string_literal: true
#
class AddPotentiallyIllegalToReviewables < ActiveRecord::Migration[7.1]
def change
add_column :reviewables, :potentially_illegal, :boolean
up_only do
# NOTE: Only for records created after this migration. Trying to
# apply this as part of adding the column will attempt to backfill
# `false` into all existing reviewables. This is dangerous (locks
# a potentially huge table) and will create some false negatives.
#
change_column_default :reviewables, :potentially_illegal, false
end
end
end