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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20210722074220_remove_null_constraint_on_schedule_from_escalation_rules.rb')
-rw-r--r--db/migrate/20210722074220_remove_null_constraint_on_schedule_from_escalation_rules.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/db/migrate/20210722074220_remove_null_constraint_on_schedule_from_escalation_rules.rb b/db/migrate/20210722074220_remove_null_constraint_on_schedule_from_escalation_rules.rb
new file mode 100644
index 00000000000..7146c6c9537
--- /dev/null
+++ b/db/migrate/20210722074220_remove_null_constraint_on_schedule_from_escalation_rules.rb
@@ -0,0 +1,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