Jira issue originally created by user kix:
As in DDC-1759, I wanted to use some reserved words as my field names (same case: MySQL-backed key-value storage).
DDC-1759 was resolved by escaping the column names in field annotations. However, I'm using YAML files to store my mappings, and I couldn't find a way to set up an escaped field name there.
Comment created by @ocramius:
Escaping fields is done via the backtick symbol ``` in column mappings. This is not driver-specific, but applies to all mappings.
Issue was closed with resolution "Invalid"
I got this error, and the first result I found on google was this thread. A working example under YAML to make a reserved word as column name:
Model\Entity:
type: entity
table: core_entity
fields:
order:
type: smallint
column: `order`
The last line did the trick (order being a reserved word in MySQL)
This is not documented anywhere (as far as I can tell) and in PHP annotations, the override is @Column( **name** ="order") instead of **column**: `order` in yaml, making this even harder to figure out.
Most helpful comment
I got this error, and the first result I found on google was this thread. A working example under YAML to make a reserved word as column name:
The last line did the trick (
orderbeing a reserved word in MySQL)