Uploaded image for project: 'Doctrine 2 - ORM'
  1. Doctrine 2 - ORM
  2. DDC-807

Adding columnDefinition for @DiscriminatorColumn

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: 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
        beberlei 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
        beberlei 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
        lstrojny 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
        lstrojny 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
        mjh_ca Marc Hodgins added a comment -

        Duplicate of DDC-553

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

          People

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

            Dates

            • Created:
              Updated:
              Resolved: