--- users-email-index

drop index users_email_uniq;

create unique index users_email_uniq
on users(
    case when deleted = 0 
        and email is not null
        and email != ''
        then lower(email)
    end
);
