in reply to Re^6: many to many with Class::DBI
in thread many to many with Class::DBI

Class::DBI's Documentation:

Consider the case of Films and Actors, with a linking Role table. First of all we'll set up our Role class:
Role->table('role'); Role->columns(Primary => qw/film actor/); Role->has_a(film => 'Film'); Role->has_a(actor => 'Actor');
I merely used the documentation, and it worked; but you're right with the id as new primary key, and Class::DBI workes as it should with this data-definition and All instead of Primary. (Tested using innodb, foreign keys were in effect :-)

regards,
tomte


Hlade's Law:

If you have a difficult task, give it to a lazy person --
they will find an easier way to do it.