discourse/db/migrate/20170222173036_make_user_auth_token_index_unique.rb
2017-02-22 12:37:11 -05:00

13 lines
379 B
Ruby

class MakeUserAuthTokenIndexUnique < ActiveRecord::Migration
def up
remove_index :user_auth_tokens, [:auth_token]
remove_index :user_auth_tokens, [:prev_auth_token]
add_index :user_auth_tokens, [:auth_token], unique: true
add_index :user_auth_tokens, [:prev_auth_token], unique: true
end
def down
# no op, this should always have been unique
end
end