[DDC-2515] Schema tool ignores index names in mapping file and uses generated name Created: 18/Jun/13  Updated: 21/Jun/13

Status: Open
Project: Doctrine 2 - ORM
Component/s: ORM, Tools
Affects Version/s: 2.3.4
Fix Version/s: None
Security Level: All

Type: Bug Priority: Minor
Reporter: Daniel Huss Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None

Attachments: Text File ddc-2515.testcase.patch    

 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.



 Comments   
Comment by Daniel Huss [ 21/Jun/13 ]

Test case for SchemaToolTest

Generated at Thu Oct 23 03:14:41 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.