Forum Linux.pl

Programowanie => PHP, *SQL => Wątek zaczęty przez: w 2010-11-01, 13:15:39

Tytuł: Schema.yml - symfony + doctrine
Wiadomość wysłana przez: w 2010-11-01, 13:15:39
Mam pytanie: tworząc plik schema.yml dla mojej strony w symfony, zauważyłem, że nie ma czegoś takiego jak foreignTable (to chyba jest dla propel). Gdzie zatem umieszczana jest informacja do której tabeli jest tworzona relacja:

Mój plik schema.yml:

HumanIndex:

   actAs: { Timestampable: ~ }
   columns:
      name:        { type: string(255), notnull: true, unique: false  }
      last_name:   { type: string(255), notnull: true, unique: false  }
      birth_date:  { type: date, notnull: false, unique: false }
      death_date:  { type: date, notnull: false, unique: false }
      father_id:   { type: integer, notnull: false, unique: false }
      mother_id:   { type: integer, notnull: false, unique: false }
      home_adress: { type: string(4000), notnull: true, unique: false }
      last_adress: { type: string(4000), notnull: false, unique: false }
      eye_color:   { type: string(16), notnull: false. unique: false }
      height:      { type: integer, notnull: false, unique: false }
      race:        { type: string(255), notnull: false, unique: false }
      personality: { type: string(4000), notnull: false, unique: false }

   relations:
      HumanIndexFather:
         class:        HumanIndex
         local:        father_id
         foreign:      id
         foreignAlias: FatherHumanIndex
         onDelete:     SET NULL
      HumanIndexMather:
         class:        HumanIndex
         local:        mother_id
         foreign:      id
         foreignAlias: MotherHumanIndex
         onDelete:     SET NULL
2) Czy relacje są tworzone dobrze?

Powinno być

HumanIndex.mother_id -> HumanIndex.id
HumanIndex.father_id -> HumanIndex.id

3) Dlaczego jak wywołam sobie coś takiego jak:

./symfony generate:module HumanIndex

to stworzy mnie moduł bez żadnych akcji podstawowych jak index, list, edit, view?

Co robie źle?