question, how do you create a unique index on a lo...
# orm-help
w
question, how do you create a unique index on a lower cased column in postgres? my use case is to prevent duplicate emails with different cases
m
Not an answer to your question but I'm just doing
emailFromForm.toLowerCase()
on the resolver prior to saving user in the database. I do that also when user is logging in to do the check against database.
w
@Maciek K is there a way to ensure this runs every time? as in, no matter where the writing happens in the database, the
toLowerCase()
always gets called