| 1 | package Test::DBIx::Class::Example::Schema::Result::CD::Artist; { | ||
| 2 | 15 | ▶ | use base 'Test::DBIx::Class::Example::Schema::Result'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | |||
| 4 | 15 | __PACKAGE__->table('cd_artist'); | |
| 5 | |||
| 6 | 15 | __PACKAGE__->add_columns( | |
| 7 | fk_artist_id => { | ||
| 8 | data_type => 'varchar', | ||
| 9 | size => '36', | ||
| 10 | is_nullable => 0, | ||
| 11 | }, | ||
| 12 | fk_cd_id => { | ||
| 13 | data_type => 'varchar', | ||
| 14 | size => '36', | ||
| 15 | is_nullable => 0, | ||
| 16 | }, | ||
| 17 | created => { | ||
| 18 | data_type => 'timestamp', | ||
| 19 | set_on_create => 1, | ||
| 20 | is_nullable => 0, | ||
| 21 | }, | ||
| 22 | ); | ||
| 23 | |||
| 24 | 15 | __PACKAGE__->set_primary_key('fk_artist_id','fk_cd_id'); | |
| 25 | |||
| 26 | 15 | __PACKAGE__->belongs_to( | |
| 27 | cd => 'Test::DBIx::Class::Example::Schema::Result::CD', | ||
| 28 | { 'foreign.cd_id' => 'self.fk_cd_id'}, | ||
| 29 | ); | ||
| 30 | |||
| 31 | 15 | __PACKAGE__->belongs_to( | |
| 32 | person_artist => 'Test::DBIx::Class::Example::Schema::Result::Person::Artist', | ||
| 33 | { 'foreign.artist_id' => 'self.fk_artist_id'}, | ||
| 34 | ); | ||
| 35 | } 1 | ||
| 36 | |||
| 37 | 15 | __END__ | |