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, {
35 __PACKAGE__->has_many( tracks => 'DBICTest::Schema::Track' );
36 __PACKAGE__->has_many(
37 tags => 'DBICTest::Schema::Tag', undef,
38 { order_by => 'tag' },
40 __PACKAGE__->has_many(
41 cd_to_producer => 'DBICTest::Schema::CD_to_Producer' => 'cd'
44 __PACKAGE__->might_have(
45 liner_notes => 'DBICTest::Schema::LinerNotes', undef,
46 { proxy => [ qw/notes/ ] },
48 __PACKAGE__->many_to_many( producers => cd_to_producer => 'producer' );
49 __PACKAGE__->many_to_many(
50 producers_sorted => cd_to_producer => 'producer',
51 { order_by => 'producer.name' },
54 __PACKAGE__->belongs_to('genre', 'DBICTest::Schema::Genre',
55 { 'foreign.genreid' => 'self.genreid' },
58 on_delete => 'SET NULL',
59 on_update => 'CASCADE',
64 #__PACKAGE__->add_relationship('genre', 'DBICTest::Schema::Genre',
65 # { 'foreign.genreid' => 'self.genreid' },
66 # { 'accessor' => 'single' }