我有一個MySQL 5.1.41數據庫,我試圖以填補原則,但原則不能正確地插入關係。我YAML是:主義並不出口關係正確
Locatie:
connection: doctrine
tableName: locatie
columns:
loc_id:
type: integer(4)
fixed: false
unsigned: false
primary: true
autoincrement: true
org_id:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
naam:
type: string(30)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
straat:
type: string(30)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
huisnummer:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
huisnummer_achtervoegsel:
type: string(3)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
plaats:
type: string(25)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
postcode:
type: string(6)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
telefoon:
type: string(12)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
opmerking:
type: string()
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
inloggegevens:
type: string()
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
relations:
Organisatie:
local: org_id
foreign: org_id
type: one
onDelete: CASCADE
onUpdate: 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
straat:
type: string(30)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
huisnummer:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
huisnummer_achtervoegsel:
type: string(3)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
plaats:
type: string(25)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
postcode:
type: string(6)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
telefoon:
type: string(12)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
opmerking:
type: string(255)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
relations:
Locatie:
local: org_id
foreign: org_id
type: many
現在,如果您的組織,然後創建具有外鍵來組織一切的位置是好的。但是當我嘗試更新與phpmyadmin的org_id我得到一個約束錯誤。如果我手動將外鍵設置爲ON_UPDATE CASCADE,它確實有效。
爲什麼教義沒有設置這個選項?
我得到了它在行走工作,但我真的想用教義這一點。