[Dbix-class] Schema design query

Dermot paikkos at googlemail.com
Fri Feb 27 08:46:53 GMT 2009


2009/2/27 Rob Kinyon <rob.kinyon at gmail.com>:
> This requirement would have a cds table, a genres table, and a
> many-to-many join table. That join table would have ( cd_id, genre_id
> ). Look up many_to_many as a relationship.
>
> Rob

I think the penny might have dropped.

The join table has, as you say, 2 columns (cd_id and genre_id).
However neither column is set as UNIQUE so you can have multiple
instances of cd_id thereby a single CD might appear more than once,
creating the many_to_many. Cool.

Would both these column be set as PK, as in the tutorials user_roles table?
Thanx,
Dp.



More information about the DBIx-Class mailing list