DDC-3568: Discriminator column in joined multiple inheritance #4388

Closed
opened 2026-01-22 14:40:47 +01:00 by admin · 3 comments
Owner

Originally created by @doctrinebot on GitHub (Feb 16, 2015).

Originally assigned to: @Ocramius on GitHub.

Jira issue originally created by user anooxy:

I'm facing an issue when trying to use multiple inheritance via discriminators. When generating a schema, only the superclass has a discriminator column.

See my test case: https://github.com/anooxy/doctrine-multiple-inheritance-test

The hierarchy is supposed to be (inheriting order):

TutorContact -> TutorStudentChildrenContact -> Contact
StudentContact -> StudentChildrenContact -> TutorStudentChildrenContact & StudentParentContact -> Contact
ParentContact -> StudentParentContact -> Contact
ChildrenContact -> StudentChildrenContact -> TutorStudentChildrenContact -> Contact

Only Contact table has a discriminator column, whereas the middle tables, which have been assigned a discriminator in the annotations, do not have one.

Originally created by @doctrinebot on GitHub (Feb 16, 2015). Originally assigned to: @Ocramius on GitHub. Jira issue originally created by user anooxy: I'm facing an issue when trying to use multiple inheritance via discriminators. When generating a schema, only the superclass has a discriminator column. See my test case: https://github.com/anooxy/doctrine-multiple-inheritance-test The hierarchy is supposed to be (inheriting order): TutorContact -> TutorStudentChildrenContact -> Contact StudentContact -> StudentChildrenContact -> TutorStudentChildrenContact & StudentParentContact -> Contact ParentContact -> StudentParentContact -> Contact ChildrenContact -> StudentChildrenContact -> TutorStudentChildrenContact -> Contact Only Contact table has a discriminator column, whereas the middle tables, which have been assigned a discriminator in the annotations, do not have one.
admin added the Bug label 2026-01-22 14:40:47 +01:00
admin closed this issue 2026-01-22 14:40:48 +01:00
Author
Owner

@doctrinebot commented on GitHub (Feb 16, 2015):

Comment created by @ocramius:

This is the expected behavior: only the root of the inheritance has the discriminator column.

@doctrinebot commented on GitHub (Feb 16, 2015): Comment created by @ocramius: This is the expected behavior: only the root of the inheritance has the discriminator column.
Author
Owner

@doctrinebot commented on GitHub (Feb 16, 2015):

Issue was closed with resolution "Invalid"

@doctrinebot commented on GitHub (Feb 16, 2015): Issue was closed with resolution "Invalid"
Author
Owner

@doctrinebot commented on GitHub (Sep 9, 2015):

Comment created by FrankHouweling:

Pleas consider mentioning this behaviour in the documentation. I spend quite some time struggling with multiple layer inheritance before I found this page.

@doctrinebot commented on GitHub (Sep 9, 2015): Comment created by FrankHouweling: Pleas consider mentioning this behaviour in the documentation. I spend quite some time struggling with multiple layer inheritance before I found this page.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4388