Commit | Line | Data |
c6d74d3e |
1 | package # hide from PAUSE |
2 | DBICTest::Schema::TwoKeys; |
a02675cd |
3 | |
4a233f30 |
4 | use warnings; |
5 | use strict; |
6 | |
660cf1be |
7 | use base qw/DBICTest::BaseResult/; |
a02675cd |
8 | |
ff657a43 |
9 | __PACKAGE__->table('twokeys'); |
10 | __PACKAGE__->add_columns( |
0009fa49 |
11 | 'artist' => { data_type => 'integer' }, |
12 | 'cd' => { data_type => 'integer' }, |
13 | ); |
ff657a43 |
14 | __PACKAGE__->set_primary_key(qw/artist cd/); |
15 | |
89cf6a70 |
16 | __PACKAGE__->belongs_to( |
17 | artist => 'DBICTest::Schema::Artist', |
18 | {'foreign.artistid'=>'self.artist'}, |
19 | ); |
20 | |
2053211a |
21 | __PACKAGE__->belongs_to( cd => 'DBICTest::Schema::CD', undef, { is_deferrable => 0, on_update => undef, on_delete => undef, add_fk_index => 0 } ); |
a02675cd |
22 | |
3bd6e3e0 |
23 | __PACKAGE__->has_many( |
24 | 'fourkeys_to_twokeys', 'DBICTest::Schema::FourKeys_to_TwoKeys', { |
25 | 'foreign.t_artist' => 'self.artist', |
26 | 'foreign.t_cd' => 'self.cd', |
27 | }); |
28 | |
29 | __PACKAGE__->many_to_many( |
30 | 'fourkeys', 'fourkeys_to_twokeys', 'fourkeys', |
31 | ); |
32 | |
a02675cd |
33 | 1; |