blob: 254a73a9b1f1bbcb6b79b3903c32257718b27ff2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# frozen_string_literal: true
class DropTempIndexOnProjectsOnIdAndRunnersTokenEncrypted < Gitlab::Database::Migration[2.0]
disable_ddl_transaction!
TEMP_INDEX_NAME = 'tmp_index_projects_on_id_and_runners_token_encrypted'
def up
finalize_background_migration 'ResetDuplicateCiRunnersTokenEncryptedValuesOnProjects'
remove_concurrent_index_by_name :projects, TEMP_INDEX_NAME
end
def down
add_concurrent_index :projects,
[:id, :runners_token_encrypted],
where: "runners_token_encrypted IS NOT NULL",
unique: false,
name: TEMP_INDEX_NAME
end
end
|