symfony 1.4.5、Doctrine 1.2、Mysql 5 を使用しています。
私の schema.yml には、うまく機能する多対多の関係がいくつかあります。しかし、結合テーブルに onDelete: CASCADE が必要です。
ドクトリンの場合、外部キーが存在する側に onDelete: CASCADE を追加する必要がありますが、refclass には schema.yml に関係がないため、できません。
スキーマの例:
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 は無視されます。
これを機能させる方法を知っている人はいますか?