mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-04-30 21:10:03 +08:00
This reduces chances of errors where consumers of strings mutate inputs and reduces memory usage of the app. Test suite passes now, but there may be some stuff left, so we will run a few sites on a branch prior to merging
14 lines
415 B
Ruby
14 lines
415 B
Ruby
# frozen_string_literal: true
|
|
|
|
class MakeUserAuthTokenIndexUnique < ActiveRecord::Migration[4.2]
|
|
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
|