[Dbix-class] Order of operations in CascadeActions::delete

Pedro Melo melo at simplicidade.org
Tue May 8 15:36:42 GMT 2007


Ok, fair enough.

Thanks.

On May 8, 2007, at 12:52 PM, Matt S Trout wrote:

> On Tue, Apr 24, 2007 at 02:25:57PM +0100, Pedro Melo wrote:
>> First, I agree with you that cascade delete on the database side is
>> probably best, and that the db-side cascading delete taking
>> preference is documented in the Relationship.pm perldoc.
>>
>> But allowing DBIC to perform the delete itself is useful when you
>> have extra business logic attached to the delete action.
>
> If you have business logic attached then you can override delete  
> and do
> whatever you like in there.
>
> The automatic code is intentionally written the way it is because  
> I've seen
> naive programmers cause massive data loss with Class::DBI's reverse  
> approach.
>
> If you want to override the DB's FK settings, you get to do it by  
> hand so it's
> Bloody Obvious (tm) in the code that that's what's going to happen.  
> It's safer
> and more maintainable that way, IME.
>
> -- 
>       Matt S Trout       Need help with your Catalyst or  
> DBIx::Class project?
>    Technical Director    Want a managed development or deployment  
> platform?
> Shadowcat Systems Ltd.   Contact mst (at) shadowcatsystems.co.uk  
> for a quote
>                                           http:// 
> www.shadowcatsystems.co.uk/
>
> _______________________________________________
> List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
> Wiki: http://dbix-class.shadowcatsystems.co.uk/
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
> Searchable Archive: http://www.mail-archive.com/dbix- 
> class at lists.rawmode.org/

-- 
Pedro Melo
Blog: http://www.simplicidade.org/notes/
Jabber ID: melo at simplicidade.org
Use Jabber!





More information about the Dbix-class mailing list