Commit 339932cb authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch 'drop-old-non-unique-index-on-mr-metrics' into 'master'

Remove non-unique index on MR metrics

See merge request gitlab-org/gitlab!36170
parents d5180b23 7c510720
---
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
...@@ -19443,8 +19443,6 @@ CREATE INDEX index_merge_request_diffs_on_merge_request_id_and_id ON public.merg ...@@ -19443,8 +19443,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);
...@@ -23588,5 +23586,6 @@ COPY "schema_migrations" (version) FROM STDIN; ...@@ -23588,5 +23586,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