-- Enforce uniqueness on users.email. Closes the duplicate-row race in
-- UserService.RegisterUser / RegisterDevice (security audit finding F-3, 2026-05-13).
-- Application code (Azaion.Services/UserService.cs) catches the resulting
-- Npgsql.PostgresException(SqlState=23505) and surfaces it as
-- BusinessException(EmailExists, code 5).
create unique index if not exists users_email_uidx on public.users (email);
