DDC-807: Adding columnDefinition for @DiscriminatorColumn #992

Closed
opened 2026-01-22 12:58:17 +01:00 by admin · 5 comments
Owner

Originally created by @doctrinebot on GitHub (Sep 15, 2010).

Jira issue originally created by user lstrojny:

Current @DiscriminatorColumn does not allow to use a specific column definition. However, in the MySQL world it is quite common to use the ENUM or TINYINT datatype for efficient discriminator columns. It would be great if something like this would be possible:

@DiscriminatorColumn(name="member_type",type="string",columnDefinition="ENUM('ANONYMOUS','FREE','PREMIUM')")
Originally created by @doctrinebot on GitHub (Sep 15, 2010). Jira issue originally created by user lstrojny: Current @DiscriminatorColumn does not allow to use a specific column definition. However, in the MySQL world it is quite common to use the ENUM or TINYINT datatype for efficient discriminator columns. It would be great if something like this would be possible: ``` @DiscriminatorColumn(name="member_type",type="string",columnDefinition="ENUM('ANONYMOUS','FREE','PREMIUM')") ```
admin added the New Feature label 2026-01-22 12:58:17 +01:00
admin closed this issue 2026-01-22 12:58:18 +01:00
Author
Owner

@doctrinebot commented on GitHub (Sep 15, 2010):

Comment created by @beberlei:

How is ENUM efficient? Its a very bad datatype in my opinion with its sorting strangeness and alter table overhead ;)

@doctrinebot commented on GitHub (Sep 15, 2010): Comment created by @beberlei: How is ENUM efficient? Its a very bad datatype in my opinion with its sorting strangeness and alter table overhead ;)
Author
Owner

@doctrinebot commented on GitHub (Sep 16, 2010):

Comment created by lstrojny:

The alternative with MySQL is TINYINT, which has the drawback of not being self documenting but also works. But this won't be possible with discriminator columns too.

@doctrinebot commented on GitHub (Sep 16, 2010): Comment created by lstrojny: The alternative with MySQL is TINYINT, which has the drawback of not being self documenting but also works. But this won't be possible with discriminator columns too.
Author
Owner

@doctrinebot commented on GitHub (Sep 17, 2010):

Comment created by mjh_ca:

Duplicate of DDC-553

@doctrinebot commented on GitHub (Sep 17, 2010): Comment created by mjh_ca: Duplicate of [DDC-553](http://www.doctrine-project.org/jira/browse/DDC-553)
Author
Owner

@doctrinebot commented on GitHub (Feb 14, 2012):

Comment created by @guilhermeblanco:

Fixed

e6b99c2059

@doctrinebot commented on GitHub (Feb 14, 2012): Comment created by @guilhermeblanco: Fixed https://github.com/doctrine/doctrine2/commit/e6b99c2059d33db744689001b477e8921c35ebfb
Author
Owner

@doctrinebot commented on GitHub (Feb 14, 2012):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Feb 14, 2012): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#992