mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
[PR #10488] Reject colliding field mapping in STI (need advice) #12399
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?
Original Pull Request: https://github.com/doctrine/orm/pull/10488
State: closed
Merged: No
When using Single Table Inheritance and two sibling classes declare fields with the same name, but different column definitions (say, one is
int, the other onestring), the resulting conflict is not raised as a problem.Current situation
The database schema will be created based on one of the two definitions. In the current example, we actually end up with an
INTcolumn. Values can not be persisted correctly, are implicitly cast/converted or lost.Expected behaviour
name="..."declarations to make sure different columns for the different fields can co-exist in the database.Probably the first one is the only feasible solution.
Additional information
ba01175700made it possible to re-process a column with a name already taken, but changing/removing that line at least does not break any tests. So, I could not figure out why this was needed (at that time).TODO