mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 19:38:32 +08:00
1ca81fbb95
* FEATURE: set notification levels when added to a group This feature allows admins and group owners to define default category and tag tracking levels that will be applied to user preferences automatically at the time when users are added to the group. Users are free to change those preferences afterwards. When removed from a group, the user's notification preferences aren't changed.
28 lines
830 B
Ruby
28 lines
830 B
Ruby
# frozen_string_literal: true
|
|
|
|
class CreateGroupDefaultTracking < ActiveRecord::Migration[6.0]
|
|
def change
|
|
create_table :group_category_notification_defaults do |t|
|
|
t.integer :group_id, null: false
|
|
t.integer :category_id, null: false
|
|
t.integer :notification_level, null: false
|
|
end
|
|
|
|
add_index :group_category_notification_defaults,
|
|
[:group_id, :category_id],
|
|
unique: true,
|
|
name: :idx_group_category_notification_defaults_unique
|
|
|
|
create_table :group_tag_notification_defaults do |t|
|
|
t.integer :group_id, null: false
|
|
t.integer :tag_id, null: false
|
|
t.integer :notification_level, null: false
|
|
end
|
|
|
|
add_index :group_tag_notification_defaults,
|
|
[:group_id, :tag_id],
|
|
unique: true,
|
|
name: :idx_group_tag_notification_defaults_unique
|
|
end
|
|
end
|