bfb6c42b106ce27472de6f33ed6103e132e86856
[dbsrgits/DBIx-Class.git] / t / lib / DBICTest / Schema / TwoKeys.pm
1 package # hide from PAUSE
2     DBICTest::Schema::TwoKeys;
3
4 use base qw/DBICTest::BaseResult/;
5
6 __PACKAGE__->table('twokeys');
7 __PACKAGE__->add_columns(
8   'artist' => { data_type => 'integer' },
9   'cd' => { data_type => 'integer' },
10 );
11 __PACKAGE__->set_primary_key(qw/artist cd/);
12
13 __PACKAGE__->belongs_to(
14     artist => 'DBICTest::Schema::Artist',
15     {'foreign.artistid'=>'self.artist'},
16 );
17
18 __PACKAGE__->belongs_to( cd => 'DBICTest::Schema::CD', undef, { is_deferrable => 0, add_fk_index => 0 } );
19
20 __PACKAGE__->has_many(
21   'fourkeys_to_twokeys', 'DBICTest::Schema::FourKeys_to_TwoKeys', {
22     'foreign.t_artist' => 'self.artist',
23     'foreign.t_cd' => 'self.cd',
24 });
25
26 __PACKAGE__->many_to_many(
27   'fourkeys', 'fourkeys_to_twokeys', 'fourkeys',
28 );
29
30 1;