using onDelete with Doctrine 2

Posted by tamir on Stack Overflow See other posts from Stack Overflow or by tamir
Published on 2011-11-29T22:12:24Z Indexed on 2011/11/30 17:51 UTC
Read the original article Hit count: 235

Filed under:
|
|
|

I can't get the onDelete to work in Doctrine2 (with YAML Mapping).

I tried this relation in my Product class:

oneToOne:
    category:
      targetEntity: Category
      onDelete: CASCADE

But that doesn't work..

EDIT:

I've set the ON DELETE: CASCADE manually in the database

imported the YAML mapping with doctrine:mapping:import,

emptied the database

updated it from the schema with doctrine:schema:update and got no ON DELETE in the foreign key.. so looks like even Doctrine doesn't know how to do it lol..

© Stack Overflow or respective owner

Related posts about mapping

Related posts about doctrine2