added more many_to_many tests and changed add_to_rel to accept linking table column...
[dbsrgits/DBIx-Class.git] / t / lib / DBICTest / Schema / TwoKeys.pm
CommitLineData
c6d74d3e 1package # hide from PAUSE
2 DBICTest::Schema::TwoKeys;
a02675cd 3
4use base 'DBIx::Class::Core';
5
ff657a43 6__PACKAGE__->table('twokeys');
7__PACKAGE__->add_columns(
0009fa49 8 'artist' => { data_type => 'integer' },
9 'cd' => { data_type => 'integer' },
10);
ff657a43 11__PACKAGE__->set_primary_key(qw/artist cd/);
12
13__PACKAGE__->belongs_to( artist => 'DBICTest::Schema::Artist' );
14__PACKAGE__->belongs_to( cd => 'DBICTest::Schema::CD' );
a02675cd 15
3bd6e3e0 16__PACKAGE__->has_many(
17 'fourkeys_to_twokeys', 'DBICTest::Schema::FourKeys_to_TwoKeys', {
18 'foreign.t_artist' => 'self.artist',
19 'foreign.t_cd' => 'self.cd',
20});
21
22__PACKAGE__->many_to_many(
23 'fourkeys', 'fourkeys_to_twokeys', 'fourkeys',
24);
25
a02675cd 261;