|
Hi, I am currently migrating a project to Catalyst + DBIx::Class and I am afraid there is no way to fully propagate cascade deletion trough a table which has more than one association 'has_many' ..
Ex. :
package solution::Schema::solutionDB::Servers;
use strict;
use warnings;
use base 'DBIx::Class';
# ..
___PACKAGE__->belongs_to(
reseller => 'solution::Schema::solutionDB::Resellers',
);
# ..
_PACKAGE__->has_many(
ref => 'solution::Schema::solutionDB::ServersAv',
'server_ref',
{ cascading_delete => 1 }
);
__PACKAGE__->has_many(
ref => 'solution::Schema::solutionDB::ServersOptions',
'server_ref',
{ cascading_delete => 1 },
);
#
# EOF
--> A call to delete_all() on the table 'Resellers' normally propagates to table 'Servers' BUT only delete entries in the table 'ServersOptions' (associated in THE LAST block 'has_many').
If I invert those two blocks, entries are not deleted from table 'ServersOptions' but from table 'ServersAv' (??!!)
It seems that a call to has_many() simply overwrites previous one !?
Did I miss something ?
Thank for your help
|