Re: Composite keys

[prev] [thread] [next] [Date index for 2005/05/04]

From: Perrin Harkins
Subject: Re: Composite keys
Date: 21:10 on 04 May 2005
On Wed, 2005-05-04 at 16:59 -0400, Kevin Old wrote:
> Basically, this ensures that the Customer and Store exist on the
> Customer Store Details Table before allowing a record (which is linked
> to it via the foreign key) to be inserted into Employee Customer Xref.

Okay, but there is no unique constraint on either of those individual
columns, so they are unique as a pair, which means has_a() won't work.

> I guess I'm not exactly sure how I need to "link" these two tables up.

It would be easier to give you advice if you could describe what the
relationship is between the tables.

Also, are you aware that Class::DBI doesn't support has_a() or has_many
() for composite foreign keys?  If these tables are 1-to-1 and you were
trying to get a CustStoreDetails that matches the primary key of the
Xref record, you will need to write a custom set_sql() query for that.

- Perrin

Composite keys
Kevin Old 19:53 on 04 May 2005

Re: Composite keys
Perrin Harkins 20:24 on 04 May 2005

Re: Composite keys
Kevin Old 20:59 on 04 May 2005

Re: Composite keys
Perrin Harkins 21:10 on 04 May 2005

Re: Composite keys
Kevin Old 21:45 on 04 May 2005

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