discourse/db/migrate/20240903024157_remove_user_passwords_indexes.rb
Kelv a455567f9e
DEV: make UserPassword 1:1 to User (#28528)
* add data migration to keep only unexpired or most recently expired user password
* refactor to 1:1 relationship between User and UserPassword
* add migration to remove redundant indexes on user passwords
2024-09-03 11:09:33 +08:00

11 lines
369 B
Ruby

# frozen_string_literal: true
class RemoveUserPasswordsIndexes < ActiveRecord::Migration[7.1]
def change
remove_index :user_passwords, %i[user_id password_hash], unique: true
remove_index :user_passwords,
%i[user_id password_expired_at password_hash],
name: "idx_user_passwords_on_user_id_and_expired_at_and_hash"
end
end