This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » plugins » User management plugins » sfDoctrineGuardUser link to UserProfile
sfDoctrineGuardUser link to UserProfile [message #102519] Thu, 15 July 2010 12:08 Go to next message
wm_maw  is currently offline wm_maw
Messages: 8
Registered: July 2010
Location: Bucuresti
Junior Member

I can't link with foreign key sfDoctrineGuardUser with UserProfile:

UserProfile:
  actAs:                  { Timestampable: ~ }
  columns:
    ip_list:              { type: string(255) notnull: true }
    brand_id:             { type: integer, notnull: false, default: NULL }
    father_id:            { type: integer }
    name:                 { type: string(55), notnull: true }
    surname:              { type: string(55), notnull: true }
    email:                { type: string(120), notnull: true }
    yahooid:              { type: string(100), notnull: true }
    is_validated:         { type: boolean, notnull: true, default: 0 }
    is_deleted:           { type: boolean, notnull: true, default: 0 }
    created_at:           { type: timestamp, notnull: true }
    updated_at:           { type: timestamp, notnull: true }
  relations:
    Brand:                { onDelete: CASCADE, onUpdate: CASCADE, local: brand_id, foreign: id, foreignAlias: Brands }
    UserProfile:          { onDelete: CASCADE, onUpdate: CASCADE, local: father_id, foreign: id }
    sfGuardUser:          { onDelete: CASCADE, onUpdate: CASCADE, local: id, foreign: id }


or

UserProfile:
  actAs:                  { Timestampable: ~ }
  columns:
    ip_list:              { type: string(255) notnull: true }
    brand_id:             { type: integer, notnull: false, default: NULL }
    father_id:            { type: integer }
    sf_guard_user_id:     { type: integer }
    name:                 { type: string(55), notnull: true }
    surname:              { type: string(55), notnull: true }
    email:                { type: string(120), notnull: true }
    yahooid:              { type: string(100), notnull: true }
    is_validated:         { type: boolean, notnull: true, default: 0 }
    is_deleted:           { type: boolean, notnull: true, default: 0 }
    created_at:           { type: timestamp, notnull: true }
    updated_at:           { type: timestamp, notnull: true }
  relations:
    Brand:                { onDelete: CASCADE, onUpdate: CASCADE, local: brand_id, foreign: id, foreignAlias: Brands }
    UserProfile:          { onDelete: CASCADE, onUpdate: CASCADE, local: father_id, foreign: id }
    sfGuardUser:          { onDelete: CASCADE, onUpdate: CASCADE, local: sf_guard_user_id, foreign: id }


They all fail with 121 or 150 error from MySQL when trying to alter table for foreign key.


this is my app.yml - but to no avail
all:
  sf_doctrine_guard_plugin:
    profile_class:                UserProfile
    profile_field_name:           id
    remember_key_expiration_age:  2592000   # 30 days in seconds
    remember_cookie_name:         vavian_remember_me


please help.


Using SYMFONY 1.4.6
icon14.gif  Re: sfDoctrineGuardUser link to UserProfile [message #102521 is a reply to message #102519 ] Thu, 15 July 2010 12:28 Go to previous message
wm_maw  is currently offline wm_maw
Messages: 8
Registered: July 2010
Location: Bucuresti
Junior Member

I managed to fix the issue.
If you have the same problem.
MANUALLY DELETE ALL MODELS an than regenerate them.
It did the trick for me. Rolling Eyes

AnD MOST IMPORTANT THE FOREIGN KEY MUST BE THE SAME TYPE:
    sf_guard_user_id:   { type: integer(4) }

[Updated on: Thu, 15 July 2010 16:10]


Using SYMFONY 1.4.6
Previous Topic:sfDoctrineGuardPlugin question
Next Topic:sfDoctrineApplyPlugin mailer error
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software