Re: Composite keys
[prev]
[thread]
[next]
[Date index for 2005/05/04]
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