summaryrefslogtreecommitdiff
path: root/db/migrate/20210722074309_add_user_fk_to_escalation_rules.rb
blob: acdfc1ed83590539a09ade0922107531626b10a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: true

class AddUserFkToEscalationRules < ActiveRecord::Migration[6.1]
  include Gitlab::Database::MigrationHelpers

  disable_ddl_transaction!

  def up
    add_concurrent_foreign_key :incident_management_escalation_rules, :users, column: :user_id, on_delete: :cascade
  end

  def down
    with_lock_retries do
      remove_foreign_key_if_exists :incident_management_escalation_rules, column: :user_id
    end
  end
end