mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Creating a index with invalid fields in the metadata does not report any error #7309
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 @stof on GitHub (Feb 5, 2024).
Bug Report
Summary
When the
fieldslist in an Index contains fields that don't exist in the entity, they are silently ignored without any warning, creating an index containing only the other fields.Current behavior
How to reproduce
Expected behavior
Ideally, this should throw a MappingException. However, this is a BC break so it will need to wait until the next major version.
In the meantime, I see 2 possible improvements (not exclusive to each other):
@stof commented on GitHub (Feb 5, 2024):
Note that configuring
columns(expecting database column names) instead offields(expecting names of mapped properties) is properly throwing an exception in DBAL for invalid column names. My guess is that the invalid fields are silently skipped when converting field names to column names when creating the DBAL Schema.