1 package DBICTest::Schema::HelperRels;
3 use base 'DBIx::Class::Core';
5 DBICTest::Schema::Artist->has_many(cds => 'DBICTest::Schema::CD', undef,
6 { order_by => 'year' });
7 DBICTest::Schema::Artist->has_many(twokeys => 'DBICTest::Schema::TwoKeys');
8 DBICTest::Schema::Artist->has_many(onekeys => 'DBICTest::Schema::OneKey');
10 DBICTest::Schema::CD->belongs_to('artist', 'DBICTest::Schema::Artist');
12 DBICTest::Schema::CD->has_many(tracks => 'DBICTest::Schema::Track');
13 DBICTest::Schema::CD->has_many(tags => 'DBICTest::Schema::Tag');
14 DBICTest::Schema::CD->has_many(cd_to_producer => 'DBICTest::Schema::CD_to_Producer' => 'cd');
16 DBICTest::Schema::CD->might_have(liner_notes => 'DBICTest::Schema::LinerNotes',
17 undef, { proxy => [ qw/notes/ ] });
19 DBICTest::Schema::SelfRefAlias->belongs_to(
20 self_ref => 'DBICTest::Schema::SelfRef');
21 DBICTest::Schema::SelfRefAlias->belongs_to(
22 alias => 'DBICTest::Schema::SelfRef');
24 DBICTest::Schema::SelfRef->has_many(
25 aliases => 'DBICTest::Schema::SelfRefAlias' => 'self_ref');
27 DBICTest::Schema::Tag->belongs_to('cd', 'DBICTest::Schema::CD');
29 DBICTest::Schema::Track->belongs_to('cd', 'DBICTest::Schema::CD');
30 DBICTest::Schema::Track->belongs_to('disc', 'DBICTest::Schema::CD', 'cd');
32 DBICTest::Schema::TwoKeys->belongs_to('artist', 'DBICTest::Schema::Artist');
33 DBICTest::Schema::TwoKeys->belongs_to('cd', 'DBICTest::Schema::CD');
35 DBICTest::Schema::CD_to_Producer->belongs_to('cd', 'DBICTest::Schema::CD', { 'foreign.cdid' => 'self.cd' });
36 DBICTest::Schema::CD_to_Producer->belongs_to('producer', 'DBICTest::Schema::Producer', { 'foreign.producerid' => 'self.producer' });
39 DBICTest::Schema::CD->many_to_many( 'producers', 'cd_to_producer', 'producer');