debian-mirror-gitlab/db/post_migrate/20210621111747_add_ci_artifacts_devops_adoption_index.rb
2021-09-30 23:02:18 +05:30

18 lines
486 B
Ruby

# frozen_string_literal: true
#
class AddCiArtifactsDevopsAdoptionIndex < ActiveRecord::Migration[6.1]
include Gitlab::Database::MigrationHelpers
disable_ddl_transaction!
NEW_INDEX = 'index_ci_job_artifacts_on_file_type_for_devops_adoption'
def up
add_concurrent_index :ci_job_artifacts, [:file_type, :project_id, :created_at], name: NEW_INDEX, where: 'file_type IN (5,6,8,23)'
end
def down
remove_concurrent_index_by_name :ci_job_artifacts, NEW_INDEX
end
end