Symfony 1.4.7

I'm having a problem using doctrine fixtures. The build --all --and-load completes with success... but part of the data is not loaded in the db. I am using the inline syntax in the fixtures to load the related detail data along with the relating master data. Well, the detail doesn't get loaded.

Supplier:
  supplier_1:
    name:     xxxxxxxxxxxxxxxxxxxxx
    address:  yyyyyyyyyyyyyyyyy
    zip_code: xxxx
    city:     Torino
    state:    TO
    vat_code: '35847593245'
    Memberships:
      membership_1: { Year: 2005}
      membership_2: { Year: 2006}
      membership_3: { Year: 2007}
      membership_4: { Year: 2008}
      membership_5: { Year: 2009}
    Contacts:
      contact_1: { ContactType: office , number: 9328475932 }

In other words, the supplier gets loaded, but neither the Memberships, nor the Contacts do. The only way that seems to work is by removing the inline syntax:

Supplier:
  supplier_1:
    name:     xxxxxxxxxxxxxxxxxxxxx
    address:  yyyyyyyyyyyyyyyyy
    zip_code: xxxx
    city:     Torino
    state:    TO
    vat_code: '35847593245'

Membership:
  membership_1: { Supplier: supplier_1, Year: 2005}
  membership_2: { Supplier: supplier_1, Year: 2006}
  membership_3: { Supplier: supplier_1, Year: 2007}
  membership_4: { Supplier: supplier_1, Year: 2008}
  membership_5: { Supplier: supplier_1, Year: 2009}

Contacts:
contact_1: { Supplier: supplier_1, ContactType: office , number: 9328475932 }

But this is really not the way I want to go... I have a lot of data to load, and keeping all the relation keys aligned seems too tricky. Any ideas?

The admin app I generate works well. The db schema seems fine. The problem is only with the fixture loading.

=======

Here is the relevant part of the schema:

Year:
  columns:
name: {type: integer(4), unique: true, notnull: true, notblank: true} member_balance_amount: {type: decimal(12,2), notnull: true, unsigned: true, default: 0}

Supplier:
  columns:
name: {type: string(100), unique: true, notnull: true, notblank: true}
    ss_code:  {type: string(20)}
    vat_code: {type: string(20)}
    address:  {type: string(200), notnull: true}
    city:     {type: string(50), notnull: true}
    state:    {type: string(10), notnull: true}
    zip_code: {type: string(10), notnull: true}
    comment:  {type: string(4000)}

Membership:
  columns:
    supplier_id: {type: integer, notnull: true}
    year_id:     {type: integer, notnull: true}
  indexes:
    supplier_year_unique: {fields: [supplier_id, year_id], type: unique}
  relations:
Supplier: {onDelete: CASCADE, local: supplier_id, foreign: id, foreignAlias: Memberships} Year: {onDelete: RESTRICT, local: year_id, foreign: id, foreignAlias: Memberships}

ContactType:
  columns:
    name: {type: string(50), unique: true, notnull: true, notblank: true}

Contact:
  columns:
    supplier_id: {type: integer, notnull: true}
    type_id:     {type: integer, notnull: true}
    number:      {type: string(50), notnull: true}
  indexes:
supplier_type_number_unique: {fields: [supplier_id, type_id, number], type: unique}
  relations:
Supplier: {onDelete: CASCADE, local: supplier_id, foreign: id, foreignAlias: Contacts} ContactType: {onDelete: RESTRICT, local: type_id, foreign: id, foreignAlias: Contacts}

=======

Here are the relevant fixtures:

Year:
  2005: {name: 2005}
  2006: {name: 2006}
  2007: {name: 2007}
  2008: {name: 2008}
  2009: {name: 2009}
  2010: {name: 2010}

ContactType:
  house:   {name: Telefono casa}
  office:  {name: Telefono ufficio}
  mobile:  {name: Telefono cellulare}
  fax:     {name: Telefax}
  email:   {name: Posta elettronica}
  chat:    {name: Identificativo chat}
  website: {name: Sito web}

Supplier:
  supplier_1:
    name:     xxxxxxxxxxxxxxxxxxxxx
    address:  yyyyyyyyyyyyyyyyy
    zip_code: xxxx
    city:     Torino
    state:    TO
    vat_code: '35847593245'
    Memberships:
      membership_1: { Year: 2005}
      membership_2: { Year: 2006}
      membership_3: { Year: 2007}
      membership_4: { Year: 2008}
      membership_5: { Year: 2009}
    Contacts:
      contact_1: { ContactType: office , number: 9328475932 }

TIA and regards,
Marco Rocci

--
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to