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

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

class DropSyncIndexCiJobArtifactsOnExpireAtForRemoval < Gitlab::Database::Migration[2.1]
  INDEX_NAME = 'index_ci_job_artifacts_on_expire_at_for_removal'
  CONDITIONS = 'locked = 0 AND expire_at IS NOT NULL'

  disable_ddl_transaction!

  def up
    remove_concurrent_index_by_name :ci_job_artifacts, name: INDEX_NAME
  end

  def down
    add_concurrent_index :ci_job_artifacts, [:expire_at], where: CONDITIONS, name: INDEX_NAME
  end
end