Re: Foreign key as primary key...

[prev] [thread] [next] [Date index for 2005/02/20]

From: Joss Shaw
Subject: Re: Foreign key as primary key...
Date: 15:13 on 20 Feb 2005
 --- Tony Bowden <tony-cdbitalk@xxxxx.xxx> wrote: 
> On Sun, Feb 20, 2005 at 01:42:52PM +0000, fdsfds
> fdsfddsf wrote:
> > An example would be three tables:
> > 
> > System:
> > ID [PK]
> > Title
> > Text, etc.
> > 
> > SystemType:
> > ID *[PK/FK refers to System table]
> > Type
> > Name, etc.
> 
> Looks like two tables rather than three, to me ...
> 
> > So in System.pm I declare the following - 
> > System->columns(Primary => qw/ID/);
> > System->has_many(types => 'SystemType');
> 
> > In SystemType.pm I declare -
> > System->columns(Primary => qw/ID/);
> > System->might_have(ID => 'System');
> 
> I would have
> 
> System->columns(All => qw/id title text .../);
> System->might_have(_type => SystemType => qw/type
> name.../);
> 
> SystemType->columns(All => qw/id type name.../);
> 
> 
> Tony


Opps!  Yes it is just two, I was going to get more
involved, but I thought it probably wasn't wise for
the sakes of clarity.  Many thanks for this Tony, I
shall give it a shot!



>joss



	
	
		
___________________________________________________________ 
ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com

(message missing)

Foreign key as primary key...
jossblowing 15:11 on 18 Feb 2005

Re: Foreign key as primary key...
Tony Bowden 16:16 on 18 Feb 2005

Re: Foreign key as primary key...
fdsfds fdsfddsf 13:42 on 20 Feb 2005

Re: Foreign key as primary key...
Tony Bowden 14:48 on 20 Feb 2005

Re: Foreign key as primary key...
Joss Shaw 15:13 on 20 Feb 2005

Re: Foreign key as primary key...
Ofer Nave 20:26 on 20 Feb 2005

Re: Foreign key as primary key...
Joss Shaw 11:22 on 22 Feb 2005

Re: Foreign key as primary key...
Perrin Harkins 18:09 on 22 Feb 2005

Generated at 11:30 on 23 Feb 2005 by mariachi v0.52