blob: 99de2646b3dec4d8157fb256f7ea745de59512fc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# frozen_string_literal: true
class CreateAlertManagementAlertAssignees < ActiveRecord::Migration[6.0]
DOWNTIME = false
ALERT_INDEX_NAME = 'index_alert_assignees_on_alert_id'
UNIQUE_INDEX_NAME = 'index_alert_assignees_on_user_id_and_alert_id'
def up
create_table :alert_management_alert_assignees do |t|
t.bigint :user_id, null: false
t.bigint :alert_id, null: false
t.index :alert_id, name: ALERT_INDEX_NAME
t.index [:user_id, :alert_id], unique: true, name: UNIQUE_INDEX_NAME
end
end
def down
drop_table :alert_management_alert_assignees
end
end
|