--- users-login

alter table users add login nvarchar(255);
alter table users add login_lower as lower(login);

create unique index users_login_uniq
on users(login_lower) 
where 
    deleted = 0
    and login is not null
    and login != ''
;
