propelorm/Propel — Issue #258: $model->delete() does not emulate CASCADE DELETE
Author: CheeseSucker
Created: 2012-01-16 16:46:22+00:00
State: open

Only Peer classes emulate cascade delete. Model objects does not cascade delete.

In the database you may have the following schema:

Persons
- Id
- Name

Balls
- Id
- Color
- PersonId [Foreign key to Persons -> Id with CASCADE DELETE]

Foreign keys should be emulated when:
1. you are using a database engine without foreign key support (*InnoDB*), or
2. you use *emulateForeignKeyConstraints = true*.

**PersonPeer::delete()** works as expected. All the balls owned by the person are deleted along with the person.
**$person->delete()**, does not work, however. The person is deleted, but the *balls are left dangling*.

As some web hosts only allows InnoDB, this should be implented.