Re: Warning if primary key is changed (was Re: Ignorance prevention)

[prev] [thread] [next] [Date index for 2004/10/24]

From: William McKee
Subject: Re: Warning if primary key is changed (was Re: Ignorance prevention)
Date: 19:25 on 24 Oct 2004
On Sun, Oct 24, 2004 at 03:06:51PM +0100, Tony Bowden wrote:
> Thanks for this, and sorry for the delay in getting round to it ..

No worries. I'm glad that it's still on the radar.


> > +			if ( defined $class->primary_column and $obj->name eq $class->primary_column->name ) {
> > +				$acc_type = "make_ro_accessor";
> > +			}
> 
> Are you deliberately only checking for single column primary keys? Or
> was this an oversight?

Oversight. I'm not sure how to handle MCPK. Any ideas?


> I think the best approach here is probably to add an is_primary method to
> Class::DBI::Column that can be checked here.

I like this idea. Would it also return a true value for a field in a MCPK?


William

        -- 
        Knowmad Services Inc.
http://www.knowmad.com

(message missing)

Ignorance prevention
William McKee 11:59 on 16 Sep 2004

Re: Ignorance prevention
Perrin Harkins 14:12 on 16 Sep 2004

Re: Warning if primary key is changed (was Re: Ignorance prevention)
William McKee 19:25 on 24 Oct 2004

Generated at 11:35 on 01 Dec 2004 by mariachi v0.52