| 1 | package Test::DBIx::Class::Example::Schema::Result::Company::Employee; { | ||
| 2 | 15 | ▶ | use base 'Test::DBIx::Class::Example::Schema::Result'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | |||
| 4 | 15 | __PACKAGE__->table('company_employee'); | |
| 5 | |||
| 6 | 15 | __PACKAGE__->add_columns( | |
| 7 | fk_company_id => { | ||
| 8 | data_type => 'varchar', | ||
| 9 | size => '36', | ||
| 10 | is_nullable => 0, | ||
| 11 | }, | ||
| 12 | fk_employee_id => { | ||
| 13 | data_type => 'varchar', | ||
| 14 | size => '36', | ||
| 15 | is_nullable => 0, | ||
| 16 | }, | ||
| 17 | fk_job_id => { | ||
| 18 | data_type => 'varchar', | ||
| 19 | size => '36', | ||
| 20 | is_nullable => 0, | ||
| 21 | }, | ||
| 22 | started => { | ||
| 23 | data_type => 'datetime', | ||
| 24 | is_nullable => 0, | ||
| 25 | }, | ||
| 26 | ended => { | ||
| 27 | data_type => 'datetime', | ||
| 28 | is_nullable => 0, | ||
| 29 | }, | ||
| 30 | ); | ||
| 31 | |||
| 32 | 15 | __PACKAGE__->set_primary_key('fk_company_id', 'fk_employee_id'); | |
| 33 | |||
| 34 | 15 | __PACKAGE__->belongs_to( | |
| 35 | job => 'Test::DBIx::Class::Example::Schema::Result::Job', | ||
| 36 | { 'foreign.job_id' => 'self.fk_job_id' }, | ||
| 37 | ); | ||
| 38 | |||
| 39 | 15 | __PACKAGE__->belongs_to( | |
| 40 | company => 'Test::DBIx::Class::Example::Schema::Result::Company', | ||
| 41 | { 'foreign.company_id' => 'self.fk_company_id' }, | ||
| 42 | ); | ||
| 43 | |||
| 44 | 15 | __PACKAGE__->belongs_to( | |
| 45 | employee => 'Test::DBIx::Class::Example::Schema::Result::Person::Employee', | ||
| 46 | { 'foreign.employee_id' => 'self.fk_employee_id' }, | ||
| 47 | ); | ||
| 48 | |||
| 49 | } 1 | ||
| 50 | |||
| 51 | 15 | __END__ | |