我使用的symfony 1.4.5,学说1.2和MySQL 5。
在我的schema.yml我有工作的伟大几个许多一对多的关系。 但我需要加入表有onDelete:CASCADE。
现在对于主义则需要添加onDelete:在哪里的外键存在,但由于refclass没有在任何schema.yml中关系我不能一边CASCADE。
示例模式:
Organisatie:
connection: doctrine
tableName: organisatie
columns:
org_id:
type: integer(4)
fixed: false
unsigned: false
primary: true
autoincrement: true
naam:
type: string(30)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
relations:
Sc:
class: Sc
refClass: ScRegel
local: org_id
foreign: sc_id
Sc:
connection: doctrine
tableName: sc
columns:
sc_id:
type: integer(4)
fixed: false
unsigned: false
primary: true
autoincrement: true
notnull: true
sc_nummer:
type: string(15)
fixed: false
unsigned: false
primary: false
autoincrement: false
notnull: true
type:
type: string(20)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
relations:
Organisatie:
class: Organisatie
refClass: ScRegel
local: sc_id
foreign: org_id
ScRegel:
connection: doctrine
tableName: sc_regel
columns:
sc_id:
type: integer(4)
primary: true
autoincrement: true
notnull: true
sc_id:
type: integer(4)
fixed: false
unsigned: false
primary: false
autoincrement: false
notnull: true
org_id:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
现在,我尝试添加onDelete:两侧(Sc和Organisatie)CASCADE,但它们将被忽略这两种情况下,关系而成,但onDelete被忽略。
有谁知道如何得到这个工作?