Foreign key as primary key...

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

From: jossblowing
Subject: Foreign key as primary key...
Date: 15:11 on 18 Feb 2005
Hello there,


I'm trying to apply CDBI to an existing DB schema. We've got a lot of tables which use foreign keys as primary keys, either on their own, or as part of a compound key. The documentation seems to suggest might_have is the way forward but I seem to be encountering a few problems. Do I for instance write -

Foo->columns(Primary => qw/foreign_key_id/);
Foo->might_have(foreign_key_id => 'Foreign::KeyTable');

and then in the Foreign::KeyTable table write - 

Foreign::KeyTable->have_many(foos => 'Foo');


I'm a little confused, I'm hoping someone could assist me please.
Kindest,


>joss

(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