Hope this will be good enough :) (see patch in attachment)
-- Sincerely yours, Oleg Kostyuk (CUB-UANIC)
Index: lib/DBIx/Class/ResultSet.pm =================================================================== --- lib/DBIx/Class/ResultSet.pm (revision 5021) +++ lib/DBIx/Class/ResultSet.pm (working copy) @@ -1329,7 +1329,23 @@ =back -Fetches all objects and deletes them one at a time. Note that C<delete_all> +Fetches all objects and deletes them one at a time. +Parent table will be deleted first and then child table(s). + +This is intentional behaviour - it produces cascade deletion under MyISAM +and SQLite where the database doesn't provide it, without affecting the +relational integrity of databases that have it. + +You need to either (a) set ON CASCADE DELETE in the database or (b) add +an explicit override in your row class such as: + + sub delete { + my $self = shift; + $self->related_things->delete; + $self->next::method(@_); + } + +Note that C<delete_all> will run DBIC cascade triggers, while L</delete> will not. =cut
_______________________________________________ List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk