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

Open
opened 2026-01-22 12:46:47 +01:00 by admin · 0 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:47 +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#684