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

20230302090155_add_async_index_on_unlocked_non_trace_job_artifacts_expire_at.rb « post_migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9f89b6916bdb1797af91144e2cbc2cfc3239f4c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

class AddAsyncIndexOnUnlockedNonTraceJobArtifactsExpireAt < Gitlab::Database::Migration[2.1]
  INDEX_NAME = 'index_ci_job_artifacts_expire_at_unlocked_non_trace'

  def up
    prepare_async_index :ci_job_artifacts, :expire_at,
      name: INDEX_NAME,
      where: 'locked = 0 AND file_type != 3 AND expire_at IS NOT NULL'
  end

  def down
    unprepare_async_index :ci_job_artifacts, :expire_at, name: INDEX_NAME
  end
end