2011-04-20 32 views
0

這裏是一個學說的模式:如何指定symfony的學說夾具空外鍵

Device: 
    columns: 
    name:   { type: string(60), } 
    os_version_id: { type: int(11), notnull: false } 
    relations: 
    OsVersion: 
     foreignAlias: Devices 

OsVersion: 
    columns: 
    version: { type: string(60), fixed: false, notnull: true } 

這裏是一個夾具:

OSV_ABCD: 
    version: ABCD 

OSV_DEFG: 
    version: DEFG 

Device: 
    Device_1: 
    name: 'My device' 
    OsVersion: null 

當加載該夾具我得到這個:

Invalid row key specified: (os_version) , referred to in (device) Device_1 

如果我將OsVersion: null更改爲OsVersion: OSV_ABCD,則加載沒有問題。

回答

0

省略外鍵行完全工作:

Device: 
    Device_1: 
    name: 'My device'