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'
27 __PACKAGE__->set_primary_key('cdid');
28 __PACKAGE__->add_unique_constraint([ qw/artist title/ ]);
30 __PACKAGE__->belongs_to( artist => 'DBICTest::Schema::Artist', undef, {
33 on_update => 'SET NULL',
36 __PACKAGE__->has_many( tracks => 'DBICTest::Schema::Track' );
37 __PACKAGE__->has_many(
38 tags => 'DBICTest::Schema::Tag', undef,
39 { order_by => 'tag' },
41 __PACKAGE__->has_many(
42 cd_to_producer => 'DBICTest::Schema::CD_to_Producer' => 'cd'
45 __PACKAGE__->might_have(
46 liner_notes => 'DBICTest::Schema::LinerNotes', undef,
47 { proxy => [ qw/notes/ ] },
49 __PACKAGE__->many_to_many( producers => cd_to_producer => 'producer' );
50 __PACKAGE__->many_to_many(
51 producers_sorted => cd_to_producer => 'producer',
52 { order_by => 'producer.name' },
55 __PACKAGE__->belongs_to('genre', 'DBICTest::Schema::Genre', { 'foreign.genreid' => 'self.genreid' });
57 #__PACKAGE__->add_relationship('genre', 'DBICTest::Schema::Genre',
58 # { 'foreign.genreid' => 'self.genreid' },
59 # { 'accessor' => 'single' }