Commit 7c510720 authored by Adam Hegyi's avatar Adam Hegyi

Remove non-unique index on MR metrics

parent 1e691756
---
title: Remove non-unique index on `merge_request_metrics.merge_request_id` column
merge_request: 36170
author:
type: changed
# frozen_string_literal: true
class DropOldNonUniqueIndexOnMrMetrics < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
INDEX_NAME = 'index_merge_request_metrics'
disable_ddl_transaction!
def up
remove_concurrent_index_by_name(:merge_request_metrics, INDEX_NAME)
end
def down
add_concurrent_index :merge_request_metrics, :merge_request_id, name: INDEX_NAME
end
end
...@@ -19437,8 +19437,6 @@ CREATE INDEX index_merge_request_diffs_on_merge_request_id_and_id ON public.merg ...@@ -19437,8 +19437,6 @@ CREATE INDEX index_merge_request_diffs_on_merge_request_id_and_id ON public.merg
CREATE INDEX index_merge_request_diffs_on_merge_request_id_and_id_partial ON public.merge_request_diffs USING btree (merge_request_id, id) WHERE ((NOT stored_externally) OR (stored_externally IS NULL)); CREATE INDEX index_merge_request_diffs_on_merge_request_id_and_id_partial ON public.merge_request_diffs USING btree (merge_request_id, id) WHERE ((NOT stored_externally) OR (stored_externally IS NULL));
CREATE INDEX index_merge_request_metrics ON public.merge_request_metrics USING btree (merge_request_id);
CREATE INDEX index_merge_request_metrics_on_first_deployed_to_production_at ON public.merge_request_metrics USING btree (first_deployed_to_production_at); CREATE INDEX index_merge_request_metrics_on_first_deployed_to_production_at ON public.merge_request_metrics USING btree (first_deployed_to_production_at);
CREATE INDEX index_merge_request_metrics_on_latest_closed_at ON public.merge_request_metrics USING btree (latest_closed_at) WHERE (latest_closed_at IS NOT NULL); CREATE INDEX index_merge_request_metrics_on_latest_closed_at ON public.merge_request_metrics USING btree (latest_closed_at) WHERE (latest_closed_at IS NOT NULL);
...@@ -23582,5 +23580,6 @@ COPY "schema_migrations" (version) FROM STDIN; ...@@ -23582,5 +23580,6 @@ COPY "schema_migrations" (version) FROM STDIN;
20200704143633 20200704143633
20200706005325 20200706005325
20200706170536 20200706170536
20200707071941
\. \.
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