CakePHP delete not cascading. Causes foreign key error.

I have a table called `custom_carts` and I have a table called `custom_cart_items`.

`custom_cart_items` has a foreign key called `custom_cart_id` that is set to `custom_cart.id`

According to the [Cake Manual][1], when you call Model->delete() the first param is the id of the entry you want to delete and the second param is whether or not to cascade delete the dependent entries.

So when I call `$this->CustomCart->delete(7,true)` I get this error:

 

> SQL Error: 1451: Cannot delete or
> update a parent row: a foreign key
> constraint fails
> (`krake`.`custom_cart_items`,
> CONSTRAINT `custom_cart_items_ibfk_1`
> FOREIGN KEY (`custom_cart_id`)
> REFERENCES `custom_carts` (`id`))

Shouldn't it *cascade* and dlete the other entry too?

So why am I getting an error?



  [1]: http://book.cakephp.org/view/1036/delete
CakePHP delete not cascading. Causes foreign key error.
===


I have a table called `custom_carts` and I have a table called `custom_cart_items`.

`custom_cart_items` has a foreign key called `custom_cart_id` that is set to `custom_cart.id`

According to the [Cake Manual][1], when you call Model->delete() the first param is the id of the entry you want to delete and the second param is whether or not to cascade delete the dependent entries.

So when I call `$this->CustomCart->delete(7,true)` I get this error:

 

> SQL Error: 1451: Cannot delete or
> update a parent row: a foreign key
> constraint fails
> (`krake`.`custom_cart_items`,
> CONSTRAINT `custom_cart_items_ibfk_1`
> FOREIGN KEY (`custom_cart_id`)
> REFERENCES `custom_carts` (`id`))

Shouldn't it *cascade* and dlete the other entry too?

So why am I getting an error?



  [1]: http://book.cakephp.org/view/1036/delete