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
|