mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Doctrine ignores Index and just takes UniqueConstraint into account for the same field #5892
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 @bentcoder on GitHub (Feb 20, 2018).
Originally assigned to: @Ocramius on GitHub.
Hi,
I am not sure if this is a bug or an expected behaviour of Doctrine.
If I set
UniqueConstraintandIndexon a same field, Doctrine ignores creating aIndexentry in database. However, if I removeUniqueConstraint, Doctrine createsIndexentry in database. Seems like we cannot set bothUniqueConstraintandIndexon a same field with Doctrine. Doctrine prefersUniqueConstraintoverIndexif they both set on a same field.Note: At database level, we can manually set UNQ and IDX on same field.
Thanks
MAPPING 1
DQL 1
MAPPING 2
DQL 2