Hi all. I have this class in my schema.yml:
Category:
  actAs: { Timestampable: ~ }
  columns:
    name: { type: string(255), notnull: true }
    cliente: { type: string(255), notnull: true, default: prova }
    modalita: { type: string(255), notnull: true, default: normale }
    id_interview: { type: integer }
    gestionale1: { type: float, notnull: true, default: 1}
    gestionale2: { type: float, notnull: true, default: 1}
    gestionale3: { type: float, notnull: true, default: 1}
    gestionale4: { type: float, notnull: true, default: 1}
    gestionale5: { type: float, notnull: true, default: 1}
    gestionale6: { type: float, notnull: true, default: 1}
    relazionali1: { type: float, notnull: true, default: 1}
    relazionali2: { type: float, notnull: true, default: 1}
    relazionali3: { type: float, notnull: true, default: 1}
    relazionali4: { type: float, notnull: true, default: 1}
    relazionali5: { type: float, notnull: true, default: 1}
    relazionali6: { type: float, notnull: true, default: 1}
    relazionali7: { type: float, notnull: true, default: 1}
    relazionali8: { type: float, notnull: true, default: 1}
    intellettive1: { type: float, notnull: true, default: 1}
    intellettive2: { type: float, notnull: true, default: 1}
    intellettive3: { type: float, notnull: true, default: 1}
    intellettive4: { type: float, notnull: true, default: 1}
    intellettive5: { type: float, notnull: true, default: 1}
    intellettive6: { type: float, notnull: true, default: 1}
    ordine: { type: integer, default: 0 }
  relations:
    Interview:     { onDelete: CASCADE, local: id_interview, foreign:
id, , foreignAlias: Headmaster }
    Utilizzi:
         class: Utilizzo
         local: category_id
         foreign: utilizzo_id
         type: many
         foreignAlias: Categories
         refClass: UtilizzoCategory
         onDelete: CASCADE
Utilizzo:
  actAs: { Timestampable: ~ }
  columns:
    name: { type: string(255), notnull: true }
    descrizione: { type: string(255) }
  relations:
    categories:
         class: Category
         refClass: UtilizzoCategory
         local: utilizzo_id
         foreign: category_id
         type: many
         foreignAlias: Utilizzi
         onDelete: CASCADE
UtilizzoCategory:
  actAs: { Timestampable: ~ }
  columns:
    category_id:
      type: integer
      primary: true
    utilizzo_id:
      type: integer
      primary: true

If I tra to delete an item of this class i receive this error:

500 | Internal Server Error | Doctrine_Connection_Mysql_Exception
SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or
update a parent row: a foreign key constraint fails
(`ssm`.`utilizzo_category`, CONSTRAINT
`utilizzo_category_category_id_category_id` FOREIGN KEY
(`category_id`) REFERENCES `category` (`id`))

-- 
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