Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-807

Adding columnDefinition for @DiscriminatorColumn

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-BETA4
    • Fix Version/s: 2.3
    • Component/s: None
    • Security Level: All
    • Labels:
      None

      Description

      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')")
      

        Activity

        Hide
        Benjamin Eberlei added a comment -

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

        Show
        Benjamin Eberlei added a comment - How is ENUM efficient? Its a very bad datatype in my opinion with its sorting strangeness and alter table overhead
        Hide
        Lars Strojny added a comment -

        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.

        Show
        Lars Strojny added a comment - 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.
        Hide
        Marc Hodgins added a comment -

        Duplicate of DDC-553

        Show
        Marc Hodgins added a comment - Duplicate of DDC-553
        Show
        Guilherme Blanco added a comment - Fixed https://github.com/doctrine/doctrine2/commit/e6b99c2059d33db744689001b477e8921c35ebfb

          People

          • Assignee:
            Fabio B. Silva
            Reporter:
            Lars Strojny
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: