Yeah, committing the new tests would help ...
[dbsrgits/DBIx-Class.git] / t / lib / DBICTest / Schema / HelperRels.pm
1 package DBICTest::Schema::BasicRels;
2
3 use base 'DBIx::Class::Core';
4
5 DBICTest::Schema::Artist->add_relationship(
6     cds => 'DBICTest::Schema::CD',
7     { 'foreign.artist' => 'self.artistid' },
8     { order_by => 'year' }
9 );
10 DBICTest::Schema::Artist->add_relationship(
11     twokeys => 'DBICTest::Schema::TwoKeys',
12     { 'foreign.artist' => 'self.artistid' }
13 );
14 DBICTest::Schema::Artist->add_relationship(
15     onekeys => 'DBICTest::Schema::OneKey',
16     { 'foreign.artist' => 'self.artistid' }
17 );
18
19 DBICTest::Schema::CD->has_one('artist', 'DBICTest::Schema::Artist');
20 #DBICTest::Schema::CD->add_relationship(
21 #    artist => 'DBICTest::Schema::Artist',
22 #    { 'foreign.artistid' => 'self.artist' },
23 #);
24 DBICTest::Schema::CD->add_relationship(
25     tracks => 'DBICTest::Schema::Track',
26     { 'foreign.cd' => 'self.cdid' }
27 );
28 DBICTest::Schema::CD->add_relationship(
29     tags => 'DBICTest::Schema::Tag',
30     { 'foreign.cd' => 'self.cdid' }
31 );
32 #DBICTest::Schema::CD->might_have(liner_notes => 'DBICTest::Schema::LinerNotes' => qw/notes/);
33 DBICTest::Schema::CD->add_relationship(
34     liner_notes => 'DBICTest::Schema::LinerNotes',
35     { 'foreign.liner_id' => 'self.cdid' },
36     { join_type => 'LEFT' }
37 );
38
39 DBICTest::Schema::SelfRefAlias->add_relationship(
40     self_ref => 'DBICTest::Schema::SelfRef',
41     { 'foreign.id' => 'self.self_ref' },
42     { accessor     => 'single' }
43
44 );
45 DBICTest::Schema::SelfRefAlias->add_relationship(
46     alias => 'DBICTest::Schema::SelfRef',
47     { 'foreign.id' => 'self.alias' },
48     { accessor     => 'single' }
49 );
50
51 DBICTest::Schema::SelfRef->add_relationship(
52     aliases => 'DBICTest::Schema::SelfRefAlias',
53     { 'foreign.self_ref' => 'self.id' },
54     { accessor => 'multi' }
55 );
56
57 DBICTest::Schema::Tag->has_one('cd', 'DBICTest::Schema::CD');
58 #DBICTest::Schema::Tag->add_relationship(
59 #    cd => 'DBICTest::Schema::CD',
60 #    { 'foreign.cdid' => 'self.cd' }
61 #);
62
63 DBICTest::Schema::Track->has_one('cd', 'DBICTest::Schema::CD');
64 #DBICTest::Schema::Track->add_relationship(
65 #    cd => 'DBICTest::Schema::CD',
66 #    { 'foreign.cdid' => 'self.cd' }
67 #);
68
69 DBICTest::Schema::TwoKeys->has_one('artist', 'DBICTest::Schema::Artist');
70 # DBICTest::Schema::TwoKeys->add_relationship(
71 #    artist => 'DBICTest::Schema::Artist',
72 #    { 'foreign.artistid' => 'self.artist' }
73 # );
74 DBICTest::Schema::TwoKeys->has_one('cd', 'DBICTest::Schema::CD');
75 #DBICTest::Schema::TwoKeys->add_relationship(
76 #    cd => 'DBICTest::Schema::CD',
77 #    { 'foreign.cdid' => 'self.cd' }
78 #);
79
80 1;