Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2989

ORM should allow custom index names for foreign associations.

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: Git Master
    • Fix Version/s: None
    • Component/s: ORM, Tools
    • Security Level: All
    • Labels:

      Description

      Now that the DBAL allows/checks for renamed indexes, the ORM implementation needs to be enhanced to allow custom naming of the indexes for foreign associations.

        Issue Links

          Activity

          Hide
          Steve Müller added a comment -

          Jonathon Suggs I have worked on a PR for this already using the exact same approach you just mentioned. However I am not quite sure about ManyToMany yet (because you would have to be able to define both index names there) and also I talked to Benjamin Eberlei and he does not seem to be happy with this approach. So I stopped work on this for the moment.

          Show
          Steve Müller added a comment - Jonathon Suggs I have worked on a PR for this already using the exact same approach you just mentioned. However I am not quite sure about ManyToMany yet (because you would have to be able to define both index names there) and also I talked to Benjamin Eberlei and he does not seem to be happy with this approach. So I stopped work on this for the moment.
          Hide
          Steve Müller added a comment -

          Moved this to ORM issues.

          Show
          Steve Müller added a comment - Moved this to ORM issues.
          Hide
          Jonathon Suggs added a comment -

          Steve I both agree and disagree.

          I think my underlying issue is your step 1.1. The ORM creates the index named "IDX_76FF8CAA8E48560F" and there is NO extension point for being able to override that behavior. FWIW, I've never been fond of the way that the ORM uses the AbstractAsset::_generateIdentifierName for generating the index and foreign key.

          So I definitely agree that its is an ORM issue not DBAL issue . However, as I stated previously, until the ORM is updated/patched to allow for index naming, this (in my opinion) is a regression despite it working the way it currently does (correct or not).

          I can close out this issue and open one for ORM. Do you have a old branch and/or ORM ticket that I can reference?

          Thanks for engaging in the dialog! I hope to be of assistance in helping come up with a solution that gets everyone happy.

          Show
          Jonathon Suggs added a comment - Steve I both agree and disagree. I think my underlying issue is your step 1.1. The ORM creates the index named "IDX_76FF8CAA8E48560F" and there is NO extension point for being able to override that behavior. FWIW, I've never been fond of the way that the ORM uses the AbstractAsset::_generateIdentifierName for generating the index and foreign key. So I definitely agree that its is an ORM issue not DBAL issue . However, as I stated previously, until the ORM is updated/patched to allow for index naming, this (in my opinion) is a regression despite it working the way it currently does (correct or not). I can close out this issue and open one for ORM. Do you have a old branch and/or ORM ticket that I can reference? Thanks for engaging in the dialog! I hope to be of assistance in helping come up with a solution that gets everyone happy.
          Hide
          Steve Müller added a comment -

          Jonathon Suggs Thanks for updating the description and thanks for assisting on this issue. We will find a solution for this before the final release of 2.5. If we cannot find a good solution until then we might also consider reverting the index renaming feature on DBAL (but I would like to avoid that). I will discuss this issue with the other core devs again and see what we can come up with.

          Show
          Steve Müller added a comment - Jonathon Suggs Thanks for updating the description and thanks for assisting on this issue. We will find a solution for this before the final release of 2.5. If we cannot find a good solution until then we might also consider reverting the index renaming feature on DBAL (but I would like to avoid that). I will discuss this issue with the other core devs again and see what we can come up with.
          Hide
          Jonathon Suggs added a comment -

          No problem, here is the start of a PR to maybe address the index names
          https://github.com/doctrine/doctrine2/pull/956

          Show
          Jonathon Suggs added a comment - No problem, here is the start of a PR to maybe address the index names https://github.com/doctrine/doctrine2/pull/956

            People

            • Assignee:
              Benjamin Eberlei
              Reporter:
              Jonathon Suggs
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: