Update to hide modules from the PAUSE Indexer.
[dbsrgits/DBIx-Class.git] / t / lib / DBICTest / Schema / HelperRels.pm
CommitLineData
c6d74d3e 1package # hide from PAUSE
2 DBICTest::Schema::HelperRels;
0567538f 3
4use base 'DBIx::Class::Core';
5
07037f89 6DBICTest::Schema::Artist->has_many(cds => 'DBICTest::Schema::CD', undef,
7 { order_by => 'year' });
8DBICTest::Schema::Artist->has_many(twokeys => 'DBICTest::Schema::TwoKeys');
9DBICTest::Schema::Artist->has_many(onekeys => 'DBICTest::Schema::OneKey');
0567538f 10
07037f89 11DBICTest::Schema::CD->belongs_to('artist', 'DBICTest::Schema::Artist');
0567538f 12
07037f89 13DBICTest::Schema::CD->has_many(tracks => 'DBICTest::Schema::Track');
5a5bec6c 14DBICTest::Schema::CD->has_many(tags => 'DBICTest::Schema::Tag', undef,
15 { order_by => 'tag' });
7411204b 16DBICTest::Schema::CD->has_many(cd_to_producer => 'DBICTest::Schema::CD_to_Producer' => 'cd');
0567538f 17
503536d5 18DBICTest::Schema::CD->might_have(liner_notes => 'DBICTest::Schema::LinerNotes',
19 undef, { proxy => [ qw/notes/ ] });
0567538f 20
07037f89 21DBICTest::Schema::SelfRefAlias->belongs_to(
22 self_ref => 'DBICTest::Schema::SelfRef');
07037f89 23DBICTest::Schema::SelfRefAlias->belongs_to(
24 alias => 'DBICTest::Schema::SelfRef');
0567538f 25
07037f89 26DBICTest::Schema::SelfRef->has_many(
27 aliases => 'DBICTest::Schema::SelfRefAlias' => 'self_ref');
0567538f 28
07037f89 29DBICTest::Schema::Tag->belongs_to('cd', 'DBICTest::Schema::CD');
30
b8777a0d 31DBICTest::Schema::Track->belongs_to('cd', 'DBICTest::Schema::CD');
1e3bc087 32DBICTest::Schema::Track->belongs_to('disc', 'DBICTest::Schema::CD', 'cd');
07037f89 33
34DBICTest::Schema::TwoKeys->belongs_to('artist', 'DBICTest::Schema::Artist');
07037f89 35DBICTest::Schema::TwoKeys->belongs_to('cd', 'DBICTest::Schema::CD');
0567538f 36
5efe4c79 37DBICTest::Schema::CD_to_Producer->belongs_to(
38 'cd', 'DBICTest::Schema::CD',
39 { 'foreign.cdid' => 'self.cd' }
40);
41DBICTest::Schema::CD_to_Producer->belongs_to(
42 'producer', 'DBICTest::Schema::Producer',
43 { 'foreign.producerid' => 'self.producer' }
44);
45DBICTest::Schema::Artist->has_many(
46 'artist_undirected_maps', 'DBICTest::Schema::ArtistUndirectedMap',
333cce60 47 [{'foreign.id1' => 'self.artistid'}, {'foreign.id2' => 'self.artistid'}],
48 { cascade_copy => 0 } # this would *so* not make sense
5efe4c79 49);
50DBICTest::Schema::ArtistUndirectedMap->belongs_to(
51 'artist1', 'DBICTest::Schema::Artist', 'id1');
52DBICTest::Schema::ArtistUndirectedMap->belongs_to(
53 'artist2', 'DBICTest::Schema::Artist', 'id2');
54DBICTest::Schema::ArtistUndirectedMap->has_many(
55 'mapped_artists', 'DBICTest::Schema::Artist',
56 [{'foreign.artistid' => 'self.id1'}, {'foreign.artistid' => 'self.id2'}]);
7411204b 57
58# now the Helpers
59DBICTest::Schema::CD->many_to_many( 'producers', 'cd_to_producer', 'producer');
0f6ac8bb 60DBICTest::Schema::CD->many_to_many( 'producers_sorted', 'cd_to_producer', 'producer', { order_by => 'producer.name' });
7411204b 61
0567538f 621;