Commit 67195ed7 authored by Alex Ives's avatar Alex Ives

Merge branch '334870-cleanup-devops-adoption-indexes' into 'master'

Remove redundant indexes for devops adoption

See merge request gitlab-org/gitlab!66644
parents fc60f4e3 7878b74a
# frozen_string_literal: true
class DevopsAdoptionDropRedundantIndexes < ActiveRecord::Migration[6.1]
include Gitlab::Database::MigrationHelpers
disable_ddl_transaction!
INDEX_SAST = 'index_ci_job_artifacts_sast_for_devops_adoption'
INDEX_DAST = 'index_ci_job_artifacts_dast_for_devops_adoption'
def up
remove_concurrent_index_by_name :ci_job_artifacts, INDEX_SAST
remove_concurrent_index_by_name :ci_job_artifacts, INDEX_DAST
end
def down
add_concurrent_index :ci_job_artifacts, [:project_id, :created_at], where: "file_type = 5", name: INDEX_SAST
add_concurrent_index :ci_job_artifacts, [:project_id, :created_at], where: "file_type = 8", name: INDEX_DAST
end
end
b4dfa045ec38a15d46288acc271a3ae93fed85b8605ab11640d9bbcfbd5b94cf
\ No newline at end of file
......@@ -23116,8 +23116,6 @@ CREATE UNIQUE INDEX index_ci_group_variables_on_group_id_and_key_and_environment
CREATE UNIQUE INDEX index_ci_instance_variables_on_key ON ci_instance_variables USING btree (key);
CREATE INDEX index_ci_job_artifacts_dast_for_devops_adoption ON ci_job_artifacts USING btree (project_id, created_at) WHERE (file_type = 8);
CREATE INDEX index_ci_job_artifacts_for_terraform_reports ON ci_job_artifacts USING btree (project_id, id) WHERE (file_type = 18);
CREATE INDEX index_ci_job_artifacts_id_for_terraform_reports ON ci_job_artifacts USING btree (id) WHERE (file_type = 18);
......@@ -23134,8 +23132,6 @@ CREATE INDEX index_ci_job_artifacts_on_project_id ON ci_job_artifacts USING btre
CREATE INDEX index_ci_job_artifacts_on_project_id_for_security_reports ON ci_job_artifacts USING btree (project_id) WHERE (file_type = ANY (ARRAY[5, 6, 7, 8]));
CREATE INDEX index_ci_job_artifacts_sast_for_devops_adoption ON ci_job_artifacts USING btree (project_id, created_at) WHERE (file_type = 5);
CREATE INDEX index_ci_job_token_project_scope_links_on_added_by_id ON ci_job_token_project_scope_links USING btree (added_by_id);
CREATE INDEX index_ci_job_token_project_scope_links_on_target_project_id ON ci_job_token_project_scope_links USING btree (target_project_id);
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