...icated columns if the columns are quotes and the JoinColumns were not
Fixed this issue where the _getInsertColumnList() method was return d…
…uplicated columns if the columns are quotes and the JoinColumns were not
This pull request fails (merged 4637e5b into cc46135).
This looks like a fix for the symptom, not the root cause.
doesn't looks like a good way to fix.
@Easen, why do you need to quoted columns and unquoted join column ?
For sure duplicated columns is a problem, but your use case does not make sense for me..
The reason for quoted columns and not quoted join columns is because that approach doesn't work when you come to update the schema of the DB. In this case when Doctrine queries MySQL for the current foreign keys, and the columns that are returned are not quoted. So when the diff is created Doctrine tries to remove these columns and recreates them, but quoted. I can appreciate that this is in fact the bug which I should be reporting.
Because of this undesired side effect I chose to quote columns and not join columns, but then another issue arose Doctrine comes to create an insert/update statement the list of columns that are produces are duplicated, the columns are quoted and appended are the join columns unquoted, for example.
INSERT INTO foo (id, barId, barId);
Just a little of background info:
The reason for these quotes it that I design my DB in MySQL Workbench and then export this into Doctrine entities. So I need a one size fits all solution for all database designs, so my approach is to quote all columns. At the end of the day Doctrine should have a problem with this.
Sorry, we couldn't accept this patch
The real problem here is the schema update that you describe
Could you create a new ticket given more details about the schema update problem ?