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
|