[DBAL-285] Schema generation fails when primary key is quoted Created: 23/May/12  Updated: 17/Apr/14  Resolved: 04/Jul/12

Status: Resolved
Project: Doctrine DBAL
Component/s: None
Affects Version/s: 2.1.6, 2.2-BETA1, 2.2-BETA2, 2.2-RC1/RC2, 2.2.0-RC3, 2.2, 2.2.1, 2.2.2
Fix Version/s: None
Security Level: All

Type: Bug Priority: Major
Reporter: Marc Easen Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None
Environment:

Linux (gentoo), PHP 5.3.13, MySQL 5.1.62, Symfony2


Attachments: Text File DBAL_Primary_key_fix.txt    

 Description   

All of our entities are generated with their name quoted with back-ticks, this is to allow RAD.
When Doctrine comes to update the schema it fails to see the primary key is quoted and thus compared an index of PRIMARY(id) to PRIMARY(`id`). Which means it then tries to drop the primary index and recreate it, using a quoted field name.

This fix is to when the primary index is created is to fetch the columns from the table and get their unquoted name, so now when the comparison takes place it looks like this PRIMARY(id) to PRIMARY(id), therefore doesn't register this as a change.



 Comments   
Comment by Benjamin Eberlei [ 04/Jul/12 ]

Fixed

Generated at Tue Nov 25 00:48:29 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.