-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add possibility to use fields instead of column for unique constraint #8345
Milestone
Comments
This is a great idea, there are some caviats.
|
The logic of resolving Unique Constraint (and Index as well) fields to columns would need to be done in |
Lustmored
added a commit
to Lustmored/orm
that referenced
this issue
Mar 4, 2021
I took a shot at this and results are in #8523 - feedback is very welcome :) |
Lustmored
added a commit
to Lustmored/orm
that referenced
this issue
Mar 9, 2021
Lustmored
added a commit
to Lustmored/orm
that referenced
this issue
Apr 2, 2021
beberlei
added a commit
that referenced
this issue
Apr 18, 2021
* Add possibility to use fields instead of column for unique constraint and indexes (#8345) * Document changes in annotation reference * phpcs * Ensure exactly one of fields/columns is set for index/uniqueConstraint * Adapt docs to fields/columns changes * phpcs * Implement fields in Attribute driver and fix mapping classes constructors. * Coding Standard * Apply suggestions from code review Co-authored-by: Grégoire Paris <[email protected]> * phpcs Co-authored-by: Jakub Caban <[email protected]> Co-authored-by: Grégoire Paris <[email protected]>
Fixed in #8629 |
@beberlei @Lustmored This is really great to hear! Thank you for implementing this 🙏 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently when using a unique constraint like:
you are forced to define the
column
name for the fields e.g.:if you don't do this and somebody configure another
naming_strategy
for your entity it will not longer work as the column does then not exist.It would be a great feature if you could use unique-constraints based on field name and doctrine orm will read the column name from the configured field e.g.:
What do you think about this?
The text was updated successfully, but these errors were encountered: