Skip to content

[make:user] add class name for UniqueConstraint #1722

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 1.x
Choose a base branch
from

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