mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #10169] Discriminator column generated value #12148
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/10169
State: closed
Merged: No
Situation:
We have a Table which have a discriminator column with a generated value.
Expected:
If we persist a new Record of the mapped Entity, the Insert should not write the discriminator value because it is auto generated.
ISSUE:
The Insert tries to insert the default value of the entity. This will fail because the value can not be inserted if it is a generated column.
Solution:
This MR allows the dev to use generated Column as a discriminator column. If a new Entity should be persisted and the discriminator column has the generated Value set, the Insert will ignore the Value of the mapped column.
I need some help to write the correct Tests.
Please can you tell me if the solution is done in the right way?