Skip to content

Conversation

seb-jean
Copy link
Contributor

@seb-jean seb-jean commented Aug 3, 2025

Sometimes we can have multiple user classes and the index name is then duplicated if we don't change it manually. I added this PR to fix this by prefixing with the class name.

For instance:
I have an Admin and User entity that I generated with make:user. The email field is used for this index.

Before:
I will then have #[ORM\UniqueConstraint(name: 'UNIQ_IDENTIFIER_EMAIL', fields: ['email'])] for User and Admin entities

After:
For the User entity, this will be:
#[ORM\UniqueConstraint(name: 'USER_UNIQ_IDENTIFIER_EMAIL', fields: ['email'])]

For the Admin entity, this will be:
#[ORM\UniqueConstraint(name: 'ADMIN_UNIQ_IDENTIFIER_EMAIL', fields: ['email'])]

@seb-jean seb-jean force-pushed the update-name-index branch from bc7c75f to cdf7591 Compare August 3, 2025 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant