提交 b2693be7 编写于 作者: S Shinya Maeda

Remove index_exists? guard

上级 a2eb053d
......@@ -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,
......@@ -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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册