whitespace clean up
[catagits/Catalyst-Controller-DBIC-API.git] / t / lib / RestTest / Schema / Result / CD.pm
CommitLineData
406086f3 1package # hide from PAUSE
d2739840 2 RestTest::Schema::Result::CD;
3
4use base 'DBIx::Class::Core';
5
6__PACKAGE__->table('cd');
7__PACKAGE__->add_columns(
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',
17 size => 100,
18 },
19 'year' => {
20 data_type => 'varchar',
21 size => 100,
22 },
23);
24__PACKAGE__->set_primary_key('cdid');
25__PACKAGE__->add_unique_constraint([ qw/artist title/ ]);
26
27__PACKAGE__->belongs_to( artist => 'RestTest::Schema::Result::Artist' );
28
29__PACKAGE__->has_many( tracks => 'RestTest::Schema::Result::Track' );
30__PACKAGE__->has_many(
31 tags => 'RestTest::Schema::Result::Tag', undef,
32 { order_by => 'tag' },
33);
34__PACKAGE__->has_many(
35 cd_to_producer => 'RestTest::Schema::Result::CD_to_Producer' => 'cd'
36);
37
38__PACKAGE__->many_to_many( producers => cd_to_producer => 'producer' );
39__PACKAGE__->many_to_many(
40 producers_sorted => cd_to_producer => 'producer',
41 { order_by => 'producer.name' },
42);
43
441;