I need to create a case-insensitive index on a column in rails. I did this via SQL:
execute( \"CREATE UNIQUE INDEX index_users_on_lower_email_index O
If you are using PostgreSQL you can change your column type to citext - case-insensitive string. It also makes search independent from the register.
citext
def change enable_extension :citext change_column :users, :email, :citext add_index :users, :email, unique: true end