Closed Raffaello closed 5 years ago
This should be mapped as:
@Column(name="`iso639-2`")
(yes, with backticks). See https://www.doctrine-project.org/projects/doctrine-orm/en/2.6/reference/limitations-and-known-issues.html#identifier-quoting-and-legacy-databases
Just a evening thought: why not adding backticks by default for eg? Instead of explicitly define them for "legacy" column?
We can't do that in 2.x, as it is a backwards compatibility break. On 3.x, we quote all identifiers.
Bug Report
Summary
having a column in MySql db like
iso_639-2
cannot be mapped into doctrine because it will be converted/cut toiso_639
Current behavior
cannot map valid DB columns into Doctrine.
How to reproduce
create a table with a PK (id) and a column named
iso_639-2
. then try to map in doctrine. Here you have the error because it would "understand" the name of the column isiso_639
.Extra note: Of course at PHP level need a simpler variable name, so the column name property mapping is the culprit of the bug.
Expected behavior
should be able to map valid DB columns, because at the mapping level are just strings.