我正在构建一个schema.yml,我试图将外键约束添加到表sf_guard_user。但是,当我做doctrine:insert-sql(edit:doctrine:build --all)时,我的表和sf_guard_user之间的链接就不存在了!我错过了什么吗?使用sfDoctrineGuardPlugin的schema.yml
我用mysql(InnoDB的)和Symfony的1.4
这里是我的schema.yml样本:
Author:
connection: doctrine
tableName: ec_author
actAs:
Sluggable:
fields: [name]
unique: true
canUpdate: false
columns:
sf_guard_user_id:
type: integer
fixed: false
unsigned: false
primary: true
autoincrement: false
name:
type: string(30)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
contents:
type: string()
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
relations:
User:
class: sfGuardUser
foreignType: one
local: sf_guard_user_id
foreign: id
有到sfGuardUser没有任何联系,即使他们中描述的schema.yml:
您使用的是什么数据库引擎? – greg0ire 2010-09-14 16:23:01
我在Mysql上使用InnoDB。 – Manu 2010-09-17 10:10:23
Manu,BaseAuthor类中存在关系吗?是否有打电话给$ this-> hasOne('sfGuardUser ...'? – 2010-09-18 16:18:36