Commit 3ec579fc authored by Andreas Brandl's avatar Andreas Brandl

Merge branch 'issue_11391_2' into 'master'

Index issues on sent_notifications

See merge request gitlab-org/gitlab!27034
parents 7c47a589 f92fcf60
---
title: Index issues on sent_notifications table
merge_request: 27034
author:
type: performance
# frozen_string_literal: true
class AddIndexOnNoteableTypeAndNoteableIdToSentNotifications < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
INDEX_NAME = 'index_sent_notifications_on_noteable_type_noteable_id'
disable_ddl_transaction!
def up
add_concurrent_index :sent_notifications,
[:noteable_id],
name: INDEX_NAME,
where: "noteable_type = 'Issue'"
end
def down
remove_concurrent_index_by_name :sent_notifications, INDEX_NAME
end
end
...@@ -3919,6 +3919,7 @@ ActiveRecord::Schema.define(version: 2020_03_13_123934) do ...@@ -3919,6 +3919,7 @@ ActiveRecord::Schema.define(version: 2020_03_13_123934) do
t.string "note_type" t.string "note_type"
t.text "position" t.text "position"
t.string "in_reply_to_discussion_id" t.string "in_reply_to_discussion_id"
t.index ["noteable_id"], name: "index_sent_notifications_on_noteable_type_noteable_id", where: "((noteable_type)::text = 'Issue'::text)"
t.index ["reply_key"], name: "index_sent_notifications_on_reply_key", unique: true t.index ["reply_key"], name: "index_sent_notifications_on_reply_key", unique: true
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment