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:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-17 18:06:17 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-17 18:06:17 +0300
commit238d22c07218adf2b8f3db630ee8b74ca6f29df5 (patch)
tree23fd5f85efef0fb95eb73bf6395d5b7e8c0f1b9f /db/migrate/20191016220135_add_join_table_for_self_managed_prometheus_alert_issues.rb
parent6b75320f525f841454f1ab162d141d3610f2e77b (diff)
Add latest changes from gitlab-org/gitlab@masterlist
Diffstat (limited to 'db/migrate/20191016220135_add_join_table_for_self_managed_prometheus_alert_issues.rb')
-rw-r--r--db/migrate/20191016220135_add_join_table_for_self_managed_prometheus_alert_issues.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/db/migrate/20191016220135_add_join_table_for_self_managed_prometheus_alert_issues.rb b/db/migrate/20191016220135_add_join_table_for_self_managed_prometheus_alert_issues.rb
new file mode 100644
index 00000000000..68b448f8836
--- /dev/null
+++ b/db/migrate/20191016220135_add_join_table_for_self_managed_prometheus_alert_issues.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+class AddJoinTableForSelfManagedPrometheusAlertIssues < ActiveRecord::Migration[5.2]
+ # Set this constant to true if this migration requires downtime.
+ DOWNTIME = false
+
+ def change
+ # Join table to Issues
+ create_table :issues_self_managed_prometheus_alert_events, id: false do |t|
+ t.references :issue, null: false,
+ index: false, # Uses the index below
+ foreign_key: { on_delete: :cascade }
+ t.references :self_managed_prometheus_alert_event, null: false,
+ index: { name: 'issue_id_issues_self_managed_rometheus_alert_events_index' },
+ foreign_key: { on_delete: :cascade }
+
+ t.timestamps_with_timezone
+ t.index [:issue_id, :self_managed_prometheus_alert_event_id],
+ unique: true, name: 'issue_id_self_managed_prometheus_alert_event_id_index'
+ end
+ end
+end