Open bodewig opened 7 years ago
email_address
is used for lookup as part of the discovery services, so it's assumed to be unique in the system, which it has been on all deployments I've been involved with so far. Having constraints on both of those across all the database flavors is probably a good idea.
I stumbled upon this when creating test data for Postgres. Repeated deployments led to the
user_info
table growing as no conflicts were raised for duplicated data.JpaUserInfoRepository
expects both thepreferred_username
andemail
columns to be unique, but this is not enforced by the database schema. Locally I've added a unique constrained forpreferred_username
as this was enough as a quick fix.We probably want
preferred_username
to be unique, but I'm not sure about the email address (otherwise I would have created a PR instead). Is it really supposed to be unique or isJpaUserInfoRepository
wrong?