« Class/Example/Schema/Result/Person/Employee.pm
↑ Summary
Class/Example/Schema/Result/RussianPhone.pm »
| 1 | package Test::DBIx::Class::Example::Schema::Result::Phone; { | ||
| 2 | 15 | ▶ | use base 'Test::DBIx::Class::Example::Schema::Result'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | |||
| 4 | 15 | __PACKAGE__->table('phone'); | |
| 5 | |||
| 6 | 15 | __PACKAGE__->add_columns( | |
| 7 | fk_person_id => { | ||
| 8 | data_type => 'varchar', | ||
| 9 | size => '36', | ||
| 10 | is_nullable => 0, | ||
| 11 | }, | ||
| 12 | number => { | ||
| 13 | data_type => 'varchar', | ||
| 14 | size => '10', | ||
| 15 | is_nullable => 0, | ||
| 16 | }, | ||
| 17 | ); | ||
| 18 | |||
| 19 | 15 | __PACKAGE__->set_primary_key('fk_person_id','number'); | |
| 20 | |||
| 21 | 15 | __PACKAGE__->belongs_to( | |
| 22 | owner => 'Test::DBIx::Class::Example::Schema::Result::Person', | ||
| 23 | { 'foreign.person_id' => 'self.fk_person_id' }, | ||
| 24 | ); | ||
| 25 | |||
| 26 | } 1 | ||
| 27 | |||
| 28 | 15 | __END__ | |