我正在使用Symfony内部的学说ORM"增强"具有引用完整性的遗留数据模型。
我有这个架构 yml 定义
AppBundleEntityQualityDataItems:
type: entity
table: quality_data_items
id:
rfi_id:
type: integer
options:
unsigned: false
id: true
rfi_type:
type: string
length: 10
id: true
manyToOne:
RfiPeople:
targetEntity: QualityDataItemsPeople
joinColumn:
rfi_type:
referencedColumnName: rfi_type_id
rfi_id:
referencedColumnName: rfi_id
fields:
issue_text:
type: text
nullable: true
length: 65535
response_text:
type: text
nullable: true
length: 65535
resolution_text:
type: text
nullable: true
length: 65535
add_to_report:
type: integer
nullable: true
options:
unsigned: false
default: '0'
add_to_report_date:
type: datetime
nullable: true
issue_cause:
type: integer
nullable: true
issue_type:
type: integer
nullable: true
issue_sub_type:
type: integer
nullable: true
linked_to_id:
type: integer
nullable: true
status_id:
type: integer
nullable: true
AppBundleEntityQualityDataItemsPeople:
type: entity
table: quality_data_items_people
id:
rfi_ppl_idx:
type: integer
generator: { strategy: AUTO }
manyToOne:
RfiJob:
targetEntity: RfiJob
joinColumn:
name: rfi_id
referencedColumnName: rfi_id
RfiType:
targetEntity: RfiType
joinColumn:
name: rfi_type
referencedColumnName: rfi_type_id
fields:
rfi_id:
type: integer
rfi_type:
type: string
length: 10
user_id:
type: integer
当我跑步时
bin/console doctrine:generate:entities AppBundle
bin/console doctrine:schema:update --dump-sql
我得到:
[DoctrineORMORMException] Column name 'id' referenced for relation from AppBundleEntityQualityDataItems towards AppBundleEntityQualityDataItemsPeople does not exist.
这些表中没有名为 id 的列。我还删除了实体类以确保其中没有任何内容
要么它没有记录也没有被支持,但你能试一试吗?
manyToOne:
RfiPeople:
targetEntity: QualityDataItemsPeople
joinColumns:
- joinColumn:
name: rfi_type_id
referencedColumnName: rfi_type_id
- joinColumn:
name: rfi_id
referencedColumnName: rfi_id