summaryrefslogtreecommitdiff
path: root/db/migrate
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-17 15:06:17 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-17 15:06:17 +0000
commit238d22c07218adf2b8f3db630ee8b74ca6f29df5 (patch)
tree23fd5f85efef0fb95eb73bf6395d5b7e8c0f1b9f /db/migrate
parent6b75320f525f841454f1ab162d141d3610f2e77b (diff)
downloadgitlab-ce-238d22c07218adf2b8f3db630ee8b74ca6f29df5.tar.gz
Add latest changes from gitlab-org/gitlab@masterlist
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20190919091300_create_evidences.rb14
-rw-r--r--db/migrate/20191003015155_add_self_managed_prometheus_alerts.rb21
-rw-r--r--db/migrate/20191016220135_add_join_table_for_self_managed_prometheus_alert_issues.rb22
3 files changed, 57 insertions, 0 deletions
diff --git a/db/migrate/20190919091300_create_evidences.rb b/db/migrate/20190919091300_create_evidences.rb
new file mode 100644
index 00000000000..3f861ed26bd
--- /dev/null
+++ b/db/migrate/20190919091300_create_evidences.rb
@@ -0,0 +1,14 @@
+# frozen_string_literal: true
+
+class CreateEvidences < ActiveRecord::Migration[5.2]
+ DOWNTIME = false
+
+ def change
+ create_table :evidences do |t|
+ t.references :release, foreign_key: { on_delete: :cascade }, null: false
+ t.timestamps_with_timezone
+ t.binary :summary_sha
+ t.jsonb :summary, null: false, default: {}
+ end
+ end
+end
diff --git a/db/migrate/20191003015155_add_self_managed_prometheus_alerts.rb b/db/migrate/20191003015155_add_self_managed_prometheus_alerts.rb
new file mode 100644
index 00000000000..94d16e921df
--- /dev/null
+++ b/db/migrate/20191003015155_add_self_managed_prometheus_alerts.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+class AddSelfManagedPrometheusAlerts < ActiveRecord::Migration[5.2]
+ # Set this constant to true if this migration requires downtime.
+ DOWNTIME = false
+
+ def change
+ create_table :self_managed_prometheus_alert_events do |t|
+ t.references :project, index: false, foreign_key: { on_delete: :cascade }, null: false
+ t.references :environment, index: true, foreign_key: { on_delete: :cascade }
+ t.datetime_with_timezone :started_at, null: false
+ t.datetime_with_timezone :ended_at
+
+ t.integer :status, null: false, limit: 2
+ t.string :title, null: false, limit: 255
+ t.string :query_expression, limit: 255
+ t.string :payload_key, null: false, limit: 255
+ t.index [:project_id, :payload_key], unique: true, name: 'idx_project_id_payload_key_self_managed_prometheus_alert_events'
+ end
+ end
+end
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