Welcome to mirror list, hosted at ThFree Co, Russian Federation.

20210722074220_remove_null_constraint_on_schedule_from_escalation_rules.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7146c6c953729142a03bfe7628c115699a80e75c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# frozen_string_literal: true

class RemoveNullConstraintOnScheduleFromEscalationRules < ActiveRecord::Migration[6.1]
  def up
    change_column_null :incident_management_escalation_rules, :oncall_schedule_id, true
  end

  def down
    exec_query 'DELETE FROM incident_management_escalation_rules WHERE oncall_schedule_id IS NULL'

    change_column_null :incident_management_escalation_rules, :oncall_schedule_id, false
  end
end