Commit | Line | Data |
c6d74d3e |
1 | package # hide from PAUSE |
2 | DBICTest::Schema::CD; |
a02675cd |
3 | |
4 | use base 'DBIx::Class::Core'; |
5 | |
ff657a43 |
6 | __PACKAGE__->table('cd'); |
7 | __PACKAGE__->add_columns( |
0009fa49 |
8 | 'cdid' => { |
9 | data_type => 'integer', |
10 | is_auto_increment => 1, |
11 | }, |
12 | 'artist' => { |
13 | data_type => 'integer', |
14 | }, |
15 | 'title' => { |
16 | data_type => 'varchar', |
cb561d1a |
17 | size => 100, |
0009fa49 |
18 | }, |
19 | 'year' => { |
20 | data_type => 'varchar', |
cb561d1a |
21 | size => 100, |
0009fa49 |
22 | }, |
23 | ); |
ff657a43 |
24 | __PACKAGE__->set_primary_key('cdid'); |
368a5228 |
25 | __PACKAGE__->add_unique_constraint([ qw/artist title/ ]); |
ff657a43 |
26 | |
27 | __PACKAGE__->belongs_to( artist => 'DBICTest::Schema::Artist' ); |
28 | |
29 | __PACKAGE__->has_many( tracks => 'DBICTest::Schema::Track' ); |
30 | __PACKAGE__->has_many( |
31 | tags => 'DBICTest::Schema::Tag', undef, |
32 | { order_by => 'tag' }, |
33 | ); |
34 | __PACKAGE__->has_many( |
35 | cd_to_producer => 'DBICTest::Schema::CD_to_Producer' => 'cd' |
36 | ); |
37 | |
38 | __PACKAGE__->might_have( |
39 | liner_notes => 'DBICTest::Schema::LinerNotes', undef, |
40 | { proxy => [ qw/notes/ ] }, |
41 | ); |
42 | __PACKAGE__->many_to_many( producers => cd_to_producer => 'producer' ); |
43 | __PACKAGE__->many_to_many( |
44 | producers_sorted => cd_to_producer => 'producer', |
45 | { order_by => 'producer.name' }, |
46 | ); |
a02675cd |
47 | |
48 | 1; |