Re: Order of before_delete trigger in docs

[prev] [thread] [next] [Date index for 2005/06/27]

From: Bill Moseley
Subject: Re: Order of before_delete trigger in docs
Date: 07:22 on 27 Jun 2005
On Mon, Jun 27, 2005 at 04:34:55AM +0300, Marius Feraru wrote:
> >$role->delete;
> >
> >results in:
> >
> >   PersonRole before_delete
> >   Role before_delete
> 
> This should only happen when you also have a reverse relation like:
>   DB::PersonRole->has_a(role => 'DB::Role', 'id');

Interesting.  Yes, if I manually setup the relationships the Role
trigger is called first.  But, using CDBI::Loader::Pg they are called
in the order above.  I'm not having any luck making the triggers get
called in the reverse order when not using CDBI::Loader, but it's late.

This started by trying to use a trigger to prevent a cascade delete
with:

DB::Role->add_trigger(before_delete => sub {
    my $role = shift;
    die "Can't delete Role ($role) -- In use by one or more Person records\n"
        if DB::PersonRole->search( { role => $role } )->first;
} );


Which doesn't work when I use CDBI::Loader but does otherwise.


        -- 
        Bill Moseley
moseley@xxxx.xxx

(message missing)

Order of before_delete trigger in docs
Bill Moseley 17:32 on 26 Jun 2005

Re: Order of before_delete trigger in docs
Tony Bowden 18:56 on 26 Jun 2005

Re: Order of before_delete trigger in docs
Marius Feraru 01:34 on 27 Jun 2005

Re: Order of before_delete trigger in docs
Bill Moseley 07:22 on 27 Jun 2005

Re: Order of before_delete trigger in docs
Tony Bowden 07:35 on 27 Jun 2005

Re: Order of before_delete trigger in docs
Marius Feraru 07:44 on 27 Jun 2005

Re: Order of before_delete trigger in docs
Tony Bowden 07:47 on 27 Jun 2005

Re: Order of before_delete trigger in docs
Marius Feraru 07:54 on 27 Jun 2005

Re: Order of before_delete trigger in docs
Marius Feraru 12:35 on 27 Jun 2005

Re: Order of before_delete trigger in docs
William Ross 14:03 on 27 Jun 2005

Re: Order of before_delete trigger in docs
Bill Moseley 15:11 on 27 Jun 2005

Re: Order of before_delete trigger in docs
Charles Bailey 16:23 on 27 Jun 2005

Re: Order of before_delete trigger in docs
William Ross 19:37 on 27 Jun 2005

Re: Order of before_delete trigger in docs
Tony Bowden 19:54 on 27 Jun 2005

Re: Order of before_delete trigger in docs
William Ross 20:52 on 27 Jun 2005

Generated at 16:37 on 28 Jul 2005 by mariachi v0.52