mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
php 8 #[UniqueConstraint] silently ignored without #[Table] attribute #6710
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Nemo64 on GitHub (May 8, 2021).
I'm playing around with the doctrine 2.9 branch and attributes and notice that the syntax for indexes changed.
https://www.doctrine-project.org/projects/doctrine-orm/en/2.9/reference/attributes-reference.html#uniqueconstraint
I really like it, the nested annotations always looked ugly to me.
However, this example does not work. You must also add a
#[Table]attribute, so this:I guess that this makes sense, since the constraint mapping belongs to the table mapping, but the current behavior of silently ignoring isn't great. It should:
@beberlei commented on GitHub (May 8, 2021):
Good catch! This is a bug
@beberlei commented on GitHub (May 9, 2021):
Fixed in #8677