Commit | Line | Data |
c6d74d3e |
1 | package # hide from PAUSE |
2 | MyStarLinkMCPK; |
ea2e61bf |
3 | |
ea2e61bf |
4 | use base 'MyBase'; |
5 | |
6 | use MyStar; |
7 | use MyFilm; |
8 | |
9 | use 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 | |
20 | sub create_sql { |
21 | return qq{ |
22 | film INTEGER NOT NULL, |
23 | star INTEGER NOT NULL, |
24 | PRIMARY KEY (film, star) |
25 | }; |
26 | } |
27 | |
28 | 1; |
29 | |