summaryrefslogtreecommitdiff
path: root/db/migrate/20200319203901_add_index_on_users_unlock_token.rb
blob: 931e685f3fe1fb06516e7c0d29630560342ad5d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# frozen_string_literal: true

class AddIndexOnUsersUnlockToken < ActiveRecord::Migration[6.0]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false
  INDEX_NAME = 'index_users_on_unlock_token'

  disable_ddl_transaction!

  def up
    add_concurrent_index :users, :unlock_token, unique: true, name: INDEX_NAME
  end

  def down
    remove_concurrent_index :users, :unlock_token, unique: true, name: INDEX_NAME
  end
end