1 -- Add case insensitive username and email uniqueness
2 -- An example of showing the dupes:
5 -- lower(name) as lname,
8 -- group by lower(name)
9 -- having count(*) > 1;
10 -- Delete username dupes, keeping the first one
22 CREATE UNIQUE INDEX idx_user_name_lower ON user_ (lower(name));
25 CREATE UNIQUE INDEX idx_user_email_lower ON user_ (lower(email));
27 -- Set empty emails properly to null