Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-192

Composite primary key workaround stopped working after SchemaTool refactoring

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0-ALPHA3
    • Fix Version/s: 2.0-ALPHA4
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      This example shows a User and a Phonenumber entity, where the Phonenumber entity has a phone column and a userId column (which maps the Phonenumber to the User). Primary key should be composite (phone, userId).

      http://pastie.org/private/uoawwvf75onnvph8bj1fwg

      Normally I would achieve this by adding @Id to the User association in Phonenumber.php, but since @Id is not supported for associations, I added a userId property (which I have to set every time I set the User property).

      After the SchemaTool refactoring, Doctrine 2 complains about duplicate keys when trying to create the database...

      see DDC-117 (@Id on associations should really be supported and add the "JoinColumn name" to the list of primary keys...)

        Activity

        Hide
        Benjamin Eberlei added a comment -

        Can you comment on this issue, is it still present?

        Show
        Benjamin Eberlei added a comment - Can you comment on this issue, is it still present?
        Hide
        Roman S. Borschel added a comment -

        Can this be considered fixed now?

        Show
        Roman S. Borschel added a comment - Can this be considered fixed now?
        Hide
        Nico Kaiser added a comment -

        Looks good!

        Show
        Nico Kaiser added a comment - Looks good!

          People

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

            Dates

            • Created:
              Updated:
              Resolved: