gitlab-org--gitlab-foss/db/migrate/20190225160301_add_runner_tokens_indexes.rb
Kamil Trzciński c5f1f7f3db Use encrypted runner tokens
This makes code to support encrypted runner tokens.
This code also finished previously started encryption
process.
2019-03-06 12:18:53 +00:00

24 lines
723 B
Ruby

# frozen_string_literal: true
class AddRunnerTokensIndexes < ActiveRecord::Migration[5.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
# It seems that `ci_runners.token_encrypted` and `projects.runners_token_encrypted`
# are non-unique
def up
add_concurrent_index :ci_runners, :token_encrypted
add_concurrent_index :projects, :runners_token_encrypted
add_concurrent_index :namespaces, :runners_token_encrypted, unique: true
end
def down
remove_concurrent_index :ci_runners, :token_encrypted
remove_concurrent_index :projects, :runners_token_encrypted
remove_concurrent_index :namespaces, :runners_token_encrypted, unique: true
end
end