[PR #5958] Avoid adding a column for the discriminator if the column is already defined #9800

Closed
opened 2026-01-22 16:05:26 +01:00 by admin · 0 comments
Owner

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.

**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.
admin added the pull-request label 2026-01-22 16:05:26 +01:00
admin closed this issue 2026-01-22 16:05:27 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#9800