Skip to content

users.user_username has no unique index #438

Closed

Description

@caseysoftware

user_username is indexed but not unique. Only CUser::isValid() checks for duplicates (user_exists()), so two concurrent creates (sign-up, LDAP first login, and from Phase 2 SCIM) can produce two users with the same login. Login then picks whichever row the database returns first.

Fix: a migration that reports existing duplicates and renames all but the oldest (name, name-2, …), then adds UNIQUE (user_username). Create paths should treat a duplicate-key error as "user exists".

Part of #458 (Phase 0 of the Identity Layer proposal (#435)).

Activity

  1. removed this from the web2project v6.0 milestone on Oct 24, 2026
  2. added a commit that references this issue on Nov 11, 2026
    bacdf59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions