Skip to content
Snippets Groups Projects
Commit b2693be7 authored by Shinya Maeda's avatar Shinya Maeda
Browse files

Remove index_exists? guard

parent a2eb053d
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -33,9 +33,7 @@ class MigrateLegacyArtifactsToJobArtifacts < ActiveRecord::Migration
# We add an temporary index to `ci_builds.artifacts_file` column to avoid statements timeout
# This index is to be removed after we have cleaned up background migrations
# https://gitlab.com/gitlab-org/gitlab-ce/issues/46866
unless index_exists?(:ci_builds, :artifacts_file)
add_concurrent_index :ci_builds, :artifacts_file, where: "artifacts_file <> ''"
end
add_concurrent_index :ci_builds, :artifacts_file, where: "artifacts_file <> ''"
 
MigrateLegacyArtifactsToJobArtifacts::Build.legacy_artifacts.without_new_artifacts.tap do |relation|
queue_background_migration_jobs_by_range_at_intervals(relation,
Loading
Loading
@@ -46,8 +44,6 @@ class MigrateLegacyArtifactsToJobArtifacts < ActiveRecord::Migration
end
 
def down
if index_exists?(:ci_builds, :artifacts_file)
remove_concurrent_index :ci_builds, :artifacts_file, where: "artifacts_file <> ''"
end
remove_concurrent_index :ci_builds, :artifacts_file, where: "artifacts_file <> ''"
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment