mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #5958] Avoid adding a column for the discriminator if the column is already defined #9800
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/5958
State: closed
Merged: No
Avoid adding a column for the discriminator if the column is already defined.
Use case:
The User entity has a ManyToOne relationship to the UserType entity.
The ManyToOne relationship is done using the column user_type_id.
I want to use this column user_type_id for the discriminator map.
Everything works except the doctrine:shema:update.
An exception is raised: The column is already defined.
The solution: For the discriminator column, do not try to add the column if this one has already been set.