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: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 :-)Role->table('role'); Role->columns(Primary => qw/film actor/); Role->has_a(film => 'Film'); Role->has_a(actor => 'Actor');
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.
|
|---|