1 package # hide from PAUSE
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 data_type => 'integer',
28 __PACKAGE__->set_primary_key('cdid');
29 __PACKAGE__->add_unique_constraint([ qw/artist title/ ]);
31 __PACKAGE__->belongs_to( artist => 'DBICTest::Schema::Artist', undef, {
34 on_update => 'SET NULL',
37 __PACKAGE__->has_many( tracks => 'DBICTest::Schema::Track' );
38 __PACKAGE__->has_many(
39 tags => 'DBICTest::Schema::Tag', undef,
40 { order_by => 'tag' },
42 __PACKAGE__->has_many(
43 cd_to_producer => 'DBICTest::Schema::CD_to_Producer' => 'cd'
46 __PACKAGE__->might_have(
47 liner_notes => 'DBICTest::Schema::LinerNotes', undef,
48 { proxy => [ qw/notes/ ] },
50 __PACKAGE__->many_to_many( producers => cd_to_producer => 'producer' );
51 __PACKAGE__->many_to_many(
52 producers_sorted => cd_to_producer => 'producer',
53 { order_by => 'producer.name' },
56 __PACKAGE__->belongs_to('genre', 'DBICTest::Schema::Genre',
57 { 'foreign.genreid' => 'self.genreid' },
58 { join_type => 'left' },
61 #__PACKAGE__->add_relationship('genre', 'DBICTest::Schema::Genre',
62 # { 'foreign.genreid' => 'self.genreid' },
63 # { 'accessor' => 'single' }