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

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

class PrepareIndexesForCiJobArtifactsExpireAtUnlocked < ActiveRecord::Migration[6.1]
  include Gitlab::Database::MigrationHelpers

  TABLE_NAME = 'ci_job_artifacts'
  INDEX_NAME = 'ci_job_artifacts_expire_at_unlocked_idx'

  def up
    prepare_async_index TABLE_NAME, [:expire_at], where: 'locked = 0', name: INDEX_NAME
  end

  def down
    unprepare_async_index_by_name TABLE_NAME, INDEX_NAME
  end
end