mirror of
https://github.com/discourse/discourse.git
synced 2025-06-02 04:08:41 +08:00
FEATURE: Support designating multiple groups as mods on category (#28655)
Currently, categories support designating only 1 group as a moderation group on the category. This commit removes the one group limitation and makes it possible to designate multiple groups as mods on a category. Internal topic: t/124648.
This commit is contained in:
@ -0,0 +1,21 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateCategoryModerationGroups < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
create_table :category_moderation_groups do |t|
|
||||
t.integer :category_id
|
||||
t.integer :group_id
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :category_moderation_groups, %i[category_id group_id], unique: true
|
||||
|
||||
execute <<~SQL
|
||||
INSERT INTO category_moderation_groups (category_id, group_id, created_at, updated_at)
|
||||
SELECT id, reviewable_by_group_id, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP
|
||||
FROM categories
|
||||
WHERE reviewable_by_group_id IS NOT NULL
|
||||
SQL
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user