diff options
author | Etienne BaquƩ <ebaque@gitlab.com> | 2019-07-19 21:00:56 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-08-27 05:39:48 +0300 |
commit | 64e24d6492f39a4ab7f2202897755afd1704f147 (patch) | |
tree | a94106a6dfb906e91084265ae3b8d75cad5d6b27 /db/migrate/20190719174505_add_index_to_deploy_tokens_token_encrypted.rb | |
parent | 84d6dcbe5040b9f0475f6b2155800617e397db94 (diff) |
Added new index to deploy_tokens table
Diffstat (limited to 'db/migrate/20190719174505_add_index_to_deploy_tokens_token_encrypted.rb')
-rw-r--r-- | db/migrate/20190719174505_add_index_to_deploy_tokens_token_encrypted.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/db/migrate/20190719174505_add_index_to_deploy_tokens_token_encrypted.rb b/db/migrate/20190719174505_add_index_to_deploy_tokens_token_encrypted.rb new file mode 100644 index 00000000000..d58d1d8348c --- /dev/null +++ b/db/migrate/20190719174505_add_index_to_deploy_tokens_token_encrypted.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddIndexToDeployTokensTokenEncrypted < ActiveRecord::Migration[5.1] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_concurrent_index :deploy_tokens, :token_encrypted, unique: true, name: "index_deploy_tokens_on_token_encrypted" + end + + def down + remove_concurrent_index_by_name :deploy_tokens, "index_deploy_tokens_on_token_encrypted" + end +end |