blob: e1e5694f4d4776bbf2f1a7dff5bde9c05d15f41d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
# frozen_string_literal: true
class AddCiJobArtifactsFileFinalPathIndex < Gitlab::Database::Migration[2.1]
disable_ddl_transaction!
INDEX_NAME = 'index_ci_job_artifacts_on_file_final_path'
WHERE_CLAUSE = 'file_final_path IS NOT NULL'
# TODO: Index to be created synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/423990
def up
prepare_async_index :ci_job_artifacts, :file_final_path, name: INDEX_NAME, where: WHERE_CLAUSE
end
def down
unprepare_async_index :ci_job_artifacts, :file_final_path, name: INDEX_NAME, where: WHERE_CLAUSE
end
end
|