如何使用YAML设置多对一关系“区域”的外键名称(编辑:不是属性本身的名称)?在Doctrine 2 ORM中命名关系?
SWA\TestBundle\Entity\Province:
type: entity
table: province
uniqueConstraints:
UNIQUE_PROVINCE_CODE:
columns: code
id:
id:
type: integer
generator: { strategy: AUTO }
fields:
code:
type: integer
name:
type: string
length: 255
short_name:
type: string
length: 2
manyToOne:
region:
targetEntity: Region
inversedBy: provinces
所以没有“标准”的方式来改变它 - 除了迁移程序?我想这个名字是完全随机的,就像FK_28392f89329。 – gremo
那么,你可能会重载平台类,但我不认为这是值得的,只是为了约束的命名。 –
同意。谢谢,赏金+回答你! – gremo