| 1 | package Test::DBIx::Class::Example::Schema::Result::CD; { | ||
| 2 | 15 | ▶ | use base 'Test::DBIx::Class::Example::Schema::Result'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | |||
| 4 | 15 | __PACKAGE__->table('cd'); | |
| 5 | |||
| 6 | 15 | __PACKAGE__->add_columns( | |
| 7 | cd_id => { | ||
| 8 | data_type => 'varchar', | ||
| 9 | size => '36', | ||
| 10 | is_nullable => 0, | ||
| 11 | }, | ||
| 12 | name => { | ||
| 13 | data_type => 'varchar', | ||
| 14 | size => '24', | ||
| 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('cd_id'); | |
| 25 | 15 | __PACKAGE__->uuid_columns('cd_id'); | |
| 26 | |||
| 27 | 15 | __PACKAGE__->has_many( | |
| 28 | cd_artist_rs => 'Test::DBIx::Class::Example::Schema::Result::CD::Artist', | ||
| 29 | { 'foreign.fk_cd_id' => 'self.cd_id'} | ||
| 30 | ); | ||
| 31 | |||
| 32 | 15 | __PACKAGE__->has_many( | |
| 33 | track_rs => 'Test::DBIx::Class::Example::Schema::Result::CD::Track', | ||
| 34 | { 'foreign.fk_cd_id' => 'self.cd_id'}, | ||
| 35 | { 'order_by' => {-asc=>'me.position'} }, | ||
| 36 | ); | ||
| 37 | |||
| 38 | 15 | __PACKAGE__->many_to_many( | |
| 39 | artists => 'cd_artist_rs', 'person_artist', | ||
| 40 | ); | ||
| 41 | |||
| 42 | } 1 | ||
| 43 | |||
| 44 | 15 | __END__ | |