Re: Foreign key as primary key...

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

From: Tony Bowden
Subject: Re: Foreign key as primary key...
Date: 14:48 on 20 Feb 2005
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


(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