Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2515

Schema tool ignores index names in mapping file and uses generated name

    Details

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

      Description

      I have defined an index on a foreign key colum in my .dcm.xml mapping file:

      <indexes>
            <index name="ix_date_created__client_id" columns="date_created,client_id"/>
            <index name="ix_user_id" columns="user_id"/>
      </indexes>
      

      However, the resulting CREATE TABLE statement includes:

          INDEX IDX_4848DD9FA76ED395 (user_id), 
          INDEX IDX_4848DD9F4239E22F (accessgroup_id), 
          INDEX IDX_4848DD9FD2112630 (usergroup_id), 
          INDEX ix_date_created__client_id (date_created, client_id), 
      

      So Doctrine seems to be auto-generating indexes for all foreign key columns. I'm assuming this is a feature, even though I'd argue that there are real-life examples where the mere presence of a foreign key constraint does not justify indexing that column.

      Anyway, the expected behavior is that Doctrine does not replace existing indexes with generated ones. I will attach a failing test case unless this bug is immediately dismissed as wontfix.

        Activity

        Daniel Huss created issue -
        Hide
        Daniel Huss added a comment -

        Test case for SchemaToolTest

        Show
        Daniel Huss added a comment - Test case for SchemaToolTest
        Daniel Huss made changes -
        Field Original Value New Value
        Attachment ddc-2515.testcase.patch [ 11618 ]

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DDC-2515, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Daniel Huss
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: