-- DataMigration -- Normalize existing usernames to lowercase so login becomes case-insensitive -- (application code now always stores/looks up usernames lowercased). If two -- users would collide after lowercasing, this UPDATE fails on the unique -- constraint -- that's intentional: it surfaces a real conflict that needs -- manual resolution rather than silently merging/dropping an account. UPDATE "User" SET username = LOWER(username) WHERE username <> LOWER(username);