Welcome to mirror list, hosted at ThFree Co, Russian Federation.

20230903064537_add_ci_job_artifacts_file_final_path_index.rb « post_migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
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