Skip to content

Fixed this issue where the _getInsertColumnList() method was return dupl... #390

wants to merge 1 commit into from

4 participants

Easen commented Jul 5, 2012

...icated columns if the columns are quotes and the JoinColumns were not

Marc Easen 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).

Doctrine member
beberlei commented Jul 5, 2012

This looks like a fix for the symptom, not the root cause.

Doctrine member

👎 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..

Easen commented Jul 15, 2012

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.

Doctrine member

Hi @Easen

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 ?


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.