2020-08-06 12:27:27 -04:00
|
|
|
# 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,
|
2023-01-09 11:59:41 +00:00
|
|
|
%i[group_id category_id],
|
|
|
|
unique: true,
|
|
|
|
name: :idx_group_category_notification_defaults_unique
|
2020-08-06 12:27:27 -04:00
|
|
|
|
|
|
|
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,
|
2023-01-09 11:59:41 +00:00
|
|
|
%i[group_id tag_id],
|
|
|
|
unique: true,
|
|
|
|
name: :idx_group_tag_notification_defaults_unique
|
2020-08-06 12:27:27 -04:00
|
|
|
end
|
|
|
|
end
|