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

Separate add_concurrent_index by database type

上级 b5f4ed37
......@@ -9,10 +9,14 @@ class AddIndexToCiBuildsArtifactsFile < ActiveRecord::Migration
# We add an temporary index to `ci_builds.artifacts_file` column to avoid statements timeout in legacy artifacts migrations
# This index is to be removed after we have cleaned up background migrations
# https://gitlab.com/gitlab-org/gitlab-ce/issues/46866
add_concurrent_index :ci_builds, :artifacts_file, where: "artifacts_file <> ''", length: 65535 - 1
if Gitlab::Database.mysql?
add_concurrent_index :ci_builds, :artifacts_file, length: 65535 - 1
else
add_concurrent_index :ci_builds, :artifacts_file, where: "artifacts_file <> ''"
end
end
def down
remove_concurrent_index :ci_builds, :artifacts_file, where: "artifacts_file <> ''", length: 65535 - 1
remove_concurrent_index :ci_builds, :artifacts_file
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册