DDC-2515: Schema tool ignores index names in mapping file and uses generated name #3237

doctrinebot opened this Issue Jun 18, 2013 · 1 comment

2 participants


Jira issue originally created by user hussdl:

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

      <index name="ix*date_created__client_id" columns="date_created,client*id"/>
      <index name="ix*user_id" columns="user*id"/>

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.


Comment created by hussdl:

Test case for SchemaToolTest

@beberlei beberlei was assigned by doctrinebot Dec 6, 2015
@doctrinebot doctrinebot added the Bug label Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment