added more many_to_many tests and changed add_to_rel to accept linking table column...
[dbsrgits/DBIx-Class.git] / t / lib / DBICTest / Schema / FourKeys_to_TwoKeys.pm
1 package # hide from PAUSE 
2     DBICTest::Schema::FourKeys_to_TwoKeys;
3
4 use base 'DBIx::Class::Core';
5
6 __PACKAGE__->table('fourkeys_to_twokeys');
7 __PACKAGE__->add_columns(
8   'f_foo' => { data_type => 'integer' },
9   'f_bar' => { data_type => 'integer' },
10   'f_hello' => { data_type => 'integer' },
11   'f_goodbye' => { data_type => 'integer' },
12   't_artist' => { data_type => 'integer' },
13   't_cd' => { data_type => 'integer' },
14   'autopilot' => { data_type => 'character' },
15 );
16 __PACKAGE__->set_primary_key(
17   qw/f_foo f_bar f_hello f_goodbye t_artist t_cd/
18 );
19
20 __PACKAGE__->belongs_to('fourkeys', 'DBICTest::Schema::FourKeys', {
21   'foreign.foo' => 'self.f_foo',
22   'foreign.bar' => 'self.f_bar',
23   'foreign.hello' => 'self.f_hello',
24   'foreign.goodbye' => 'self.f_goodbye',
25 });
26
27 __PACKAGE__->belongs_to('twokeys', 'DBICTest::Schema::TwoKeys', {
28   'foreign.artist' => 'self.t_artist',
29   'foreign.cd' => 'self.t_cd',
30 });
31
32 1;