1 package # hide from PAUSE
2 RestTest::Schema::Result::CD;
4 use base 'DBIx::Class::Core';
6 __PACKAGE__->table('cd');
7 __PACKAGE__->add_columns(
9 data_type => 'integer',
10 is_auto_increment => 1,
13 data_type => 'integer',
16 data_type => 'varchar',
20 data_type => 'varchar',
24 __PACKAGE__->set_primary_key('cdid');
25 __PACKAGE__->add_unique_constraint([ qw/artist title/ ]);
27 __PACKAGE__->belongs_to( artist => 'RestTest::Schema::Result::Artist' );
29 __PACKAGE__->has_many( tracks => 'RestTest::Schema::Result::Track' );
30 __PACKAGE__->has_many(
31 tags => 'RestTest::Schema::Result::Tag', undef,
32 { order_by => 'tag' },
34 __PACKAGE__->has_many(
35 cd_to_producer => 'RestTest::Schema::Result::CD_to_Producer' => 'cd'
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' },