Commit 253591a3 authored by Adam Hegyi's avatar Adam Hegyi

Merge branch '38096-add-index-on-resource-weight-events-created-at-pd' into 'master'

Add index on resource_weight_events for created_at

See merge request gitlab-org/gitlab!28930
parents ee33e657 d9c4fdc6
---
title: Add index to issue_id and created_at of resource_weight_events
merge_request: 28930
author:
type: other
# frozen_string_literal: true
class AddIndexToIssueIdAndCreatedAtOnResourceWeightEvents < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
INDEX_NAME = 'index_resource_weight_events_on_issue_id_and_created_at'
DOWNTIME = false
disable_ddl_transaction!
def up
add_concurrent_index :resource_weight_events, [:issue_id, :created_at], name: INDEX_NAME
end
def down
remove_concurrent_index_by_name :resource_weight_events, INDEX_NAME
end
end
......@@ -10160,6 +10160,8 @@ CREATE INDEX index_resource_milestone_events_on_milestone_id ON public.resource_
CREATE INDEX index_resource_milestone_events_on_user_id ON public.resource_milestone_events USING btree (user_id);
CREATE INDEX index_resource_weight_events_on_issue_id_and_created_at ON public.resource_weight_events USING btree (issue_id, created_at);
CREATE INDEX index_resource_weight_events_on_issue_id_and_weight ON public.resource_weight_events USING btree (issue_id, weight);
CREATE INDEX index_resource_weight_events_on_user_id ON public.resource_weight_events USING btree (user_id);
......@@ -13232,6 +13234,7 @@ COPY "schema_migrations" (version) FROM STDIN;
20200406102111
20200406102120
20200406135648
20200406141452
20200406192059
20200406193427
20200407094005
......
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