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/20210729202143_create_incident_management_issuable_escalation_statuses.rb')
-rw-r--r--db/migrate/20210729202143_create_incident_management_issuable_escalation_statuses.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/db/migrate/20210729202143_create_incident_management_issuable_escalation_statuses.rb b/db/migrate/20210729202143_create_incident_management_issuable_escalation_statuses.rb
new file mode 100644
index 00000000000..b16904a3b47
--- /dev/null
+++ b/db/migrate/20210729202143_create_incident_management_issuable_escalation_statuses.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+class CreateIncidentManagementIssuableEscalationStatuses < ActiveRecord::Migration[6.1]
+ ISSUE_IDX = 'index_uniq_im_issuable_escalation_statuses_on_issue_id'
+ POLICY_IDX = 'index_im_issuable_escalation_statuses_on_policy_id'
+
+ def change
+ create_table :incident_management_issuable_escalation_statuses do |t|
+ t.timestamps_with_timezone
+
+ t.references :issue, foreign_key: { on_delete: :cascade }, index: { unique: true, name: ISSUE_IDX }, null: false
+ t.references :policy, foreign_key: { to_table: :incident_management_escalation_policies, on_delete: :nullify }, index: { name: POLICY_IDX }
+
+ t.datetime_with_timezone :escalations_started_at
+ t.datetime_with_timezone :resolved_at
+
+ t.integer :status, default: 0, null: false, limit: 2
+ end
+ end
+end