diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-08 03:06:10 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-08 03:06:10 +0300 |
commit | ca95fe0b55e6a350aeb978ecc7fbd31c44ab84f4 (patch) | |
tree | e23037ca692a991665930dd0de90d0a05c56659d /db | |
parent | 8c8b94e7116fa478ad490bd14c09565d23097f57 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20190905022045_add_issues_prometheus_alert_event_join_table.rb | 22 | ||||
-rw-r--r-- | db/schema.rb | 11 |
2 files changed, 33 insertions, 0 deletions
diff --git a/db/migrate/20190905022045_add_issues_prometheus_alert_event_join_table.rb b/db/migrate/20190905022045_add_issues_prometheus_alert_event_join_table.rb new file mode 100644 index 00000000000..861b97f0a09 --- /dev/null +++ b/db/migrate/20190905022045_add_issues_prometheus_alert_event_join_table.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +class AddIssuesPrometheusAlertEventJoinTable < ActiveRecord::Migration[5.2] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def change + create_table :issues_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 :prometheus_alert_event, null: false, + index: { name: 'issue_id_issues_prometheus_alert_events_index' }, + foreign_key: { on_delete: :cascade } + + t.timestamps_with_timezone + t.index [:issue_id, :prometheus_alert_event_id], + unique: true, name: 'issue_id_prometheus_alert_event_id_index' + end + end +end diff --git a/db/schema.rb b/db/schema.rb index eaba76f3f1a..81d19b9c8d0 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1877,6 +1877,15 @@ ActiveRecord::Schema.define(version: 2019_09_29_180827) do t.index ["updated_by_id"], name: "index_issues_on_updated_by_id", where: "(updated_by_id IS NOT NULL)" end + create_table "issues_prometheus_alert_events", id: false, force: :cascade do |t| + t.bigint "issue_id", null: false + t.bigint "prometheus_alert_event_id", null: false + t.datetime_with_timezone "created_at", null: false + t.datetime_with_timezone "updated_at", null: false + t.index ["issue_id", "prometheus_alert_event_id"], name: "issue_id_prometheus_alert_event_id_index", unique: true + t.index ["prometheus_alert_event_id"], name: "issue_id_issues_prometheus_alert_events_index" + end + create_table "jira_connect_installations", force: :cascade do |t| t.string "client_key" t.string "encrypted_shared_secret" @@ -4071,6 +4080,8 @@ ActiveRecord::Schema.define(version: 2019_09_29_180827) do add_foreign_key "issues", "users", column: "author_id", name: "fk_05f1e72feb", on_delete: :nullify add_foreign_key "issues", "users", column: "closed_by_id", name: "fk_c63cbf6c25", on_delete: :nullify add_foreign_key "issues", "users", column: "updated_by_id", name: "fk_ffed080f01", on_delete: :nullify + add_foreign_key "issues_prometheus_alert_events", "issues", on_delete: :cascade + add_foreign_key "issues_prometheus_alert_events", "prometheus_alert_events", on_delete: :cascade add_foreign_key "jira_connect_subscriptions", "jira_connect_installations", on_delete: :cascade add_foreign_key "jira_connect_subscriptions", "namespaces", on_delete: :cascade add_foreign_key "jira_tracker_data", "services", on_delete: :cascade |