1package MyStarLinkMCPK; 2 3BEGIN { unshift @INC, './t/testlib'; } 4use base 'MyBase'; 5 6use MyStar; 7use MyFilm; 8 9use strict; 10 11# This is a many-to-many mapping table that uses the two foreign keys 12# as its own primary key - there's no extra 'auto-inc' column here 13 14__PACKAGE__->set_table(); 15__PACKAGE__->columns(Primary => qw/film star/); 16__PACKAGE__->columns(All => qw/film star/); 17__PACKAGE__->has_a(film => 'MyFilm'); 18__PACKAGE__->has_a(star => 'MyStar'); 19 20sub create_sql { 21 return qq{ 22 film INTEGER NOT NULL, 23 star INTEGER NOT NULL, 24 PRIMARY KEY (film, star) 25 }; 26} 27 281; 29 30