Welcome to mirror list, hosted at ThFree Co, Russian Federation.

20231009104325_add_partial_match_index_of_hashes_on_credit_card_validations.rb « post_migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6baf2a8413b2f73672de6a062af5f682141facf8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# frozen_string_literal: true

class AddPartialMatchIndexOfHashesOnCreditCardValidations < Gitlab::Database::Migration[2.1]
  disable_ddl_transaction!

  INDEX_NAME = 'idx_user_credit_card_validations_on_similar_to_meta_data'
  INDEX_FIELDS = [:expiration_date_hash, :last_digits_hash, :network_hash, :credit_card_validated_at]

  def up
    add_concurrent_index :user_credit_card_validations, INDEX_FIELDS, name: INDEX_NAME
  end

  def down
    remove_concurrent_index_by_name :user_credit_card_validations, INDEX_NAME
  end
end