DDC-553: Should @DiscriminatorColumn support columnDefinition attribute just like @Column ? #686

Closed
opened 2026-01-22 12:46:51 +01:00 by admin · 2 comments
Owner

Originally created by @doctrinebot on GitHub (Apr 28, 2010).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user mjh_ca:

Still getting into setting up models with Doctrine2 and testing as I go...

It is my understanding that the @DiscriminatorColumn annotation defines a table column in the underlying table (i.e. when run through SchemaTool).

If this is correct, shouldn't @DiscriminatorColumn support the columnDefinition attribute? This would allow this field to be setup as an ENUM in MySQL, for example... i.e.

/****
 * @Entity
 * @InheritanceType("JOINED")
 * @DiscriminatorColumn(name="discr", type="string", columnDefinition="ENUM('foo', 'bar', 'baz')")
 * @DiscriminatorMap({"foo" = "FooEntity", "bar" = "BarEntity", "baz" = "BazEntity"})
 */
class ParentEntity {
    // ...
}
Originally created by @doctrinebot on GitHub (Apr 28, 2010). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user mjh_ca: Still getting into setting up models with Doctrine2 and testing as I go... It is my understanding that the @DiscriminatorColumn annotation defines a table column in the underlying table (i.e. when run through SchemaTool). If this is correct, shouldn't @DiscriminatorColumn support the columnDefinition attribute? This would allow this field to be setup as an ENUM in MySQL, for example... i.e. ``` /**** * @Entity * @InheritanceType("JOINED") * @DiscriminatorColumn(name="discr", type="string", columnDefinition="ENUM('foo', 'bar', 'baz')") * @DiscriminatorMap({"foo" = "FooEntity", "bar" = "BarEntity", "baz" = "BazEntity"}) */ class ParentEntity { // ... } ```
admin added the Improvement label 2026-01-22 12:46:51 +01:00
admin closed this issue 2026-01-22 12:46:52 +01:00
Author
Owner

@doctrinebot commented on GitHub (May 1, 2010):

Comment created by @beberlei:

This clutters the mapping code, i am against it, the use case is pretty slim.

@doctrinebot commented on GitHub (May 1, 2010): Comment created by @beberlei: This clutters the mapping code, i am against it, the use case is pretty slim.
Author
Owner

@doctrinebot commented on GitHub (May 1, 2010):

Issue was closed with resolution "Won't Fix"

@doctrinebot commented on GitHub (May 1, 2010): Issue was closed with resolution "Won't Fix"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#686