0b7f55aa8843e372d47611b75fd1e439536d30e8
[dbsrgits/DBIx-Class.git] / t / cdbi / testlib / MyStarLinkMCPK.pm
1 package # hide from PAUSE
2     MyStarLinkMCPK;
3
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