[DBIx-Class-Devel] Re: [dbix-class] cascaded delete must delete relationships first (#27)

Alexander Hartmaier notifications at github.com
Fri May 24 08:07:27 GMT 2013


What I imagined is which RDBMS supports cascading could be included in the Storage classes, no autodetection.
If cascading in the DB is declared, the rel config should match this and should be taken into account for deploy.
I don't say it's something I need/want.

What would make up a feature for me is to be able to control if cascade delete is handled by DBIC before as @gbarr suggested to trigger delete method modifiers of related result classes, e.g.
Device->has_many('Interface')->belongs_to('Line')
Interface has a delete around method modifier that checks if it was the last interface of its related line, if so deletes the line after being deleted.
This interface method modifier isn't trigger if one deletes a whole device. I had to add a method modifier to the device delete method to loop through the related interfaces and delete them.

---
Reply to this email directly or view it on GitHub:
https://github.com/dbsrgits/dbix-class/pull/27#issuecomment-18391796
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class-devel/attachments/20130524/ebbf26e9/attachment.htm


More information about the DBIx-Class-Devel mailing list