0

我使用 symfony 1.4.11。我使用 sfDoctrineGuardPlugin 和 sfDoctrineApplyPlugin.All 工作正常,但是......后端,它只从 sf_guard_user 表中删除了他的个人资料,但它不会从 sf_guard_user_profile 表中删除他的个人资料......那么如何修复它?也许我在两个插件的配置中出错了?谢谢!

sfGuardUserProfile:
  connection: doctrine
  tableName: sf_guard_user_profile
  columns:
    id:            { type: integer(4), primary: true, autoincrement: true }
    user_id:       { type: integer(4), notnull: true , primary: false }
    salutation:    { type: string(10), notnull: true }
    first_name:    { type: string(30), notnull: true }
    last_name:     { type: string(30), notnull: true }
    country:       { type: string(255), notnull: true }
    postcode:      { type: string(10) , notnull: true }
    city:          { type: string(255), notnull: true }
    address:       { type: string()   , notnull: true }
    phone:         { type: string(50) }
    email:         { type: string(255), notnull: true }
    validate:      { type: string(17) }
    banned:        { type: boolean, default: 0 }
    payed_until:   { type: datetime, notnull: true}
  relations:
    User:
      class: sfGuardUser
      foreign: id
      local: user_id
      type: one
      onDelete: cascade
      foreignType: one
      foreignAlias: Profile
4

2 回答 2

1

只需将我的数据库从 MyISAM 更改为 INNODB,一切正常!

于 2011-06-09T21:56:02.110 回答
0

关于创建新用户 - 首先我不确定这两个插件中是否有这样的功能。(至少我不知道)。

关于从sf_guard_user_profile表中删除用户和相关数据- 我认为关系定义很可能存在一些问题。在定义sf_guard_user_profile表的安装部分再次检查sfDoctrineApplyPlugin自述文件。您需要为用户关系设置onDelete: 级联。

最后检查是否生成了正确的 sql 并将其应用于数据库模式。

问候。

于 2011-06-03T14:18:29.847 回答