Debian Codegraph @

t/cdbi-t-ocache/testlib/MyStarLinkMCPK.pm

raw
1 package MyStarLinkMCPK;
2
3 BEGIN { unshift @INC, './t/cdbi-t/testlib'; }
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