Details
-
Type:
Bug
-
Status:
Awaiting Feedback
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Schema Managers
-
Security Level: All
-
Labels:None
-
Environment:Ubuntu 12.04 with MySQL 5.5 and PHP 5.4
Description
I using the Doctrine Migrations and when I declared my entity with the indexes section, the index name has been ignored. It's like this:
indexes:
IDX_ADDRESS_CITY:
columns: city_id
but, the diff tools ignore it and give me this code:
$this->addSql("CREATE INDEX IDX_7299B5238BAC62AF ON tb_address (city_id)");
and it should be:
$this->addSql("CREATE INDEX IDX_ADDRESS_CITY ON tb_address (city_id)");
Notice: I open the same bug on the migrations repository in github and @kimhemsoe told me to open here, since this is generated by DBAL component.
Did you specify an index name in the indexes property for your entity in your PHP file? In this case, you should have something like:
indexes={@Index(name="IDX_ADDRESS_CITY", columns={"city_id"})}That should result in the correct SQL being generated. If I modify the above to:
indexes={@Index(columns={"city_id"})}I also get a migration that has SQL with an auto-generated index name.