Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Delete Cascade
  • Hi, Well I like that cute, smart ORM but right now it makes me a headach. I have a many-many-relation setup between users and items, please have a look at this model: http://dl.dropbox.com/u/2603932/database.PNG Well I can't delete Items, Categories and Users.. if I try for example removing a user, following error rises:
    Fuel\Core\Database_Exception [ 1451 ]: Cannot delete or update a parent row: a foreign key constraint fails (`paosao`.`ratings`, CONSTRAINT `fk_items_has_users_users1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION) [ DELETE FROM `users` WHERE `id` = '1' LIMIT 1 ] I don't understand why, because I set delete cascade true. May I'm blind, maybe it's a bug. Any hint in this bloody bug is welcome. Models: http://scrp.at/ayW
    greetings
    Sven PS: Formatting Buttons don't work for me (latest Chrome)
  • Looks like you have constraints on the database level, which interferes with the way ORM handles cascading deletes?

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion