Commit f95da9de authored by Adam Hegyi's avatar Adam Hegyi Committed by Patrick Bair

Cleanup first_mentioned_in_commit_at migration

parent 478de5cf
# frozen_string_literal: true
class CleanupFirstMentionedInCommitJobs < Gitlab::Database::Migration[1.0]
disable_ddl_transaction!
MIGRATION = 'FixFirstMentionedInCommitAt'
INDEX_NAME = 'index_issue_metrics_first_mentioned_in_commit'
def up
finalize_background_migration(MIGRATION)
remove_concurrent_index_by_name :issue_metrics, name: INDEX_NAME
end
def down
# Handles reported schema inconsistencies (column with or without timezone)
# We did the same in db/post_migrate/20211004110500_add_temporary_index_to_issue_metrics.rb
condition = Gitlab::BackgroundMigration::FixFirstMentionedInCommitAt::TmpIssueMetrics
.first_mentioned_in_commit_at_condition
add_concurrent_index :issue_metrics, :issue_id, where: condition, name: INDEX_NAME
end
end
c30656c3f079e789f386b5b607710a7d4df6d2eb20bd457bab3a2e8d9eeb051b
\ No newline at end of file
...@@ -26346,8 +26346,6 @@ CREATE UNIQUE INDEX index_issue_links_on_source_id_and_target_id ON issue_links ...@@ -26346,8 +26346,6 @@ CREATE UNIQUE INDEX index_issue_links_on_source_id_and_target_id ON issue_links
CREATE INDEX index_issue_links_on_target_id ON issue_links USING btree (target_id); CREATE INDEX index_issue_links_on_target_id ON issue_links USING btree (target_id);
CREATE INDEX index_issue_metrics_first_mentioned_in_commit ON issue_metrics USING btree (issue_id) WHERE (date_part('year'::text, first_mentioned_in_commit_at) > (2019)::double precision);
CREATE INDEX index_issue_metrics_on_issue_id_and_timestamps ON issue_metrics USING btree (issue_id, first_mentioned_in_commit_at, first_associated_with_milestone_at, first_added_to_board_at); CREATE INDEX index_issue_metrics_on_issue_id_and_timestamps ON issue_metrics USING btree (issue_id, first_mentioned_in_commit_at, first_associated_with_milestone_at, first_added_to_board_at);
CREATE INDEX index_issue_on_project_id_state_id_and_blocking_issues_count ON issues USING btree (project_id, state_id, blocking_issues_count); CREATE INDEX index_issue_on_project_id_state_id_and_blocking_issues_count ON issues USING btree (project_id, state_id, blocking_issues_count);
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