Add index on merge_requests for :target_project_id & :draft
What does this MR do?
.drafts
was added in !62718 (merged), and it was suggested by a reviewer we proactively add a scope here.
Up
== 20210603192745 AddIndexForDraftFieldOnMergeRequests: migrating =============
-- transaction_open?()
-> 0.0000s
-- index_exists?(:merge_requests, [:target_project_id, :draft], {:name=>"index_merge_requests_on_target_project_id_and_draft", :algorithm=>:concurrently})
-> 0.0223s
-- execute("SET statement_timeout TO 0")
-> 0.0011s
-- add_index(:merge_requests, [:target_project_id, :draft], {:name=>"index_merge_requests_on_target_project_id_and_draft", :algorithm=>:concurrently})
-> 0.0069s
-- execute("RESET ALL")
-> 0.0009s
== 20210603192745 AddIndexForDraftFieldOnMergeRequests: migrated (0.0332s) ====
Down
== 20210603192745 AddIndexForDraftFieldOnMergeRequests: reverting =============
-- transaction_open?()
-> 0.0000s
-- indexes(:merge_requests)
-> 0.0266s
-- execute("SET statement_timeout TO 0")
-> 0.0010s
-- remove_index(:merge_requests, {:algorithm=>:concurrently, :name=>"index_merge_requests_on_target_project_id_and_draft"})
-> 0.0054s
-- execute("RESET ALL")
-> 0.0011s
== 20210603192745 AddIndexForDraftFieldOnMergeRequests: reverted (0.0364s) ====
Related to #332208 (closed)
Edited by Kerri Miller