Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-200

Support for "columnDefinition" in @Column

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0-ALPHA4
    • Component/s: None
    • Security Level: All
    • Labels:
      None

      Description

      Support for columnDefinition (The SQL fragment that is used when generating the DDL for the column).

           /**
            * @Column(name="name", type="string", columnDefinition="CHAR(32)")
            */
           public $name;
      

      See this mail for details:
      http://groups.google.com/group/doctrine-user/browse_thread/thread/2cf813c72e4f15a8

        Issue Links

          Activity

          Hide
          Benjamin Eberlei added a comment -

          Implemented - Can you test it and give some feedback Nico?

          Btw, I found a way to pass the definition to the join column

          Show
          Benjamin Eberlei added a comment - Implemented - Can you test it and give some feedback Nico? Btw, I found a way to pass the definition to the join column
          Hide
          Roman S. Borschel added a comment -

          @Benjamin: Good work! Btw. you accidentily committed several *.php.orig files, presumably remainders from conflicts during merging.

          Show
          Roman S. Borschel added a comment - @Benjamin: Good work! Btw. you accidentily committed several *.php.orig files, presumably remainders from conflicts during merging.
          Hide
          Roman S. Borschel added a comment -

          I see that you left out columnDefinition from @JoinColumn. Is it not needed anymore? I think it would still be very useful. Even more, looking at your testcase, one common issue with the current behavior of taking the definition over is NOT NULL. Join columns / foreign keys are often supposed to be nullable, contrary to the primary key they are referring to.

          So I think columnDefinition for @JoinColumn is needed.

          Show
          Roman S. Borschel added a comment - I see that you left out columnDefinition from @JoinColumn. Is it not needed anymore? I think it would still be very useful. Even more, looking at your testcase, one common issue with the current behavior of taking the definition over is NOT NULL. Join columns / foreign keys are often supposed to be nullable, contrary to the primary key they are referring to. So I think columnDefinition for @JoinColumn is needed.
          Hide
          Benjamin Eberlei added a comment -

          Ah ok, this is indeed an issue that needs to be adressed.

          Damn the .orig files, i'll remove them tonight.

          Show
          Benjamin Eberlei added a comment - Ah ok, this is indeed an issue that needs to be adressed. Damn the .orig files, i'll remove them tonight.
          Hide
          Nico Kaiser added a comment -

          Looks great! I successfully ran our tests and even changed an Integer primarykey to "mediumint", so passing the definition to the join column seems to work! Thanks for integrating!

          Show
          Nico Kaiser added a comment - Looks great! I successfully ran our tests and even changed an Integer primarykey to "mediumint", so passing the definition to the join column seems to work! Thanks for integrating!

            People

            • Assignee:
              Benjamin Eberlei
              Reporter:
              Nico Kaiser
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: