I have a table 'users' with column 'email'. It used to be unique (with index), but a new requirement is to allow nils there.
Is there a better solution than:
remove_index :users, :email add_index :users, :email
?
Initially it was added with option unique:
add_index :users, :email, :unique => true
I would say that you have the correct solution there as the index will need to be regenerated, hence why there is no update_index
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With