summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-10 12:07:55 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-10 12:07:55 +0000
commit5e11c9b77cb1b2b77ee29359047b55807afe255d (patch)
tree40b02dead6acdcaab9cc15efc9ae4710c2ed78a8 /db
parent97d4d926630822d0e1a638206909679c962d2f0a (diff)
downloadgitlab-ce-5e11c9b77cb1b2b77ee29359047b55807afe255d.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20191106150931_add_timelog_spent_at_index.rb20
-rw-r--r--db/migrate/20191122161519_create_sentry_issues_table.rb15
-rw-r--r--db/schema.rb8
3 files changed, 43 insertions, 0 deletions
diff --git a/db/migrate/20191106150931_add_timelog_spent_at_index.rb b/db/migrate/20191106150931_add_timelog_spent_at_index.rb
new file mode 100644
index 00000000000..2412b77d0bf
--- /dev/null
+++ b/db/migrate/20191106150931_add_timelog_spent_at_index.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+# See http://doc.gitlab.com/ce/development/migration_style_guide.html
+# for more information on how to write migrations for GitLab.
+
+class AddTimelogSpentAtIndex < ActiveRecord::Migration[5.2]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :timelogs, :spent_at, where: 'spent_at IS NOT NULL'
+ end
+
+ def down
+ remove_concurrent_index :timelogs, :spent_at, where: 'spent_at IS NOT NULL'
+ end
+end
diff --git a/db/migrate/20191122161519_create_sentry_issues_table.rb b/db/migrate/20191122161519_create_sentry_issues_table.rb
new file mode 100644
index 00000000000..753286b6025
--- /dev/null
+++ b/db/migrate/20191122161519_create_sentry_issues_table.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class CreateSentryIssuesTable < ActiveRecord::Migration[5.2]
+ DOWNTIME = false
+
+ def change
+ create_table :sentry_issues do |t|
+ t.references :issue,
+ foreign_key: { on_delete: :cascade },
+ index: { unique: true },
+ null: false
+ t.bigint :sentry_issue_identifier, null: false
+ end
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index da8dba2e83d..e3df8af0ea0 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -3607,6 +3607,12 @@ ActiveRecord::Schema.define(version: 2019_12_06_122926) do
t.index ["reply_key"], name: "index_sent_notifications_on_reply_key", unique: true
end
+ create_table "sentry_issues", force: :cascade do |t|
+ t.bigint "issue_id", null: false
+ t.bigint "sentry_issue_identifier", null: false
+ t.index ["issue_id"], name: "index_sentry_issues_on_issue_id", unique: true
+ end
+
create_table "service_desk_settings", primary_key: "project_id", id: :bigint, default: nil, force: :cascade do |t|
t.string "issue_template_key", limit: 255
end
@@ -3812,6 +3818,7 @@ ActiveRecord::Schema.define(version: 2019_12_06_122926) do
t.datetime "spent_at"
t.index ["issue_id"], name: "index_timelogs_on_issue_id"
t.index ["merge_request_id"], name: "index_timelogs_on_merge_request_id"
+ t.index ["spent_at"], name: "index_timelogs_on_spent_at", where: "(spent_at IS NOT NULL)"
t.index ["user_id"], name: "index_timelogs_on_user_id"
end
@@ -4660,6 +4667,7 @@ ActiveRecord::Schema.define(version: 2019_12_06_122926) do
add_foreign_key "scim_oauth_access_tokens", "namespaces", column: "group_id", on_delete: :cascade
add_foreign_key "self_managed_prometheus_alert_events", "environments", on_delete: :cascade
add_foreign_key "self_managed_prometheus_alert_events", "projects", on_delete: :cascade
+ add_foreign_key "sentry_issues", "issues", on_delete: :cascade
add_foreign_key "service_desk_settings", "projects", on_delete: :cascade
add_foreign_key "services", "projects", name: "fk_71cce407f9", on_delete: :cascade
add_foreign_key "slack_integrations", "services", on_delete: :cascade