| 1 | package Test::DBIx::Class::Example::Schema::Result::Person; { | ||
| 2 | 15 | ▶ | use base 'Test::DBIx::Class::Example::Schema::Result'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | |||
| 4 | 15 | __PACKAGE__->table('person'); | |
| 5 | |||
| 6 | 15 | __PACKAGE__->add_columns( | |
| 7 | person_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 | age => { | ||
| 18 | data_type => 'integer', | ||
| 19 | is_nullable => 0, | ||
| 20 | }, | ||
| 21 | email => { | ||
| 22 | data_type => 'varchar', | ||
| 23 | size=>'128', | ||
| 24 | is_nullable => 1, | ||
| 25 | }, | ||
| 26 | created => { | ||
| 27 | data_type => 'timestamp', | ||
| 28 | set_on_create => 1, | ||
| 29 | is_nullable => 0, | ||
| 30 | }, | ||
| 31 | ); | ||
| 32 | |||
| 33 | 15 | __PACKAGE__->set_primary_key('person_id'); | |
| 34 | 15 | __PACKAGE__->uuid_columns('person_id'); | |
| 35 | |||
| 36 | 15 | __PACKAGE__->has_many( | |
| 37 | phone_rs => 'Test::DBIx::Class::Example::Schema::Result::Phone', | ||
| 38 | { 'foreign.fk_person_id' => 'self.person_id' }, | ||
| 39 | ); | ||
| 40 | |||
| 41 | 15 | __PACKAGE__->might_have( | |
| 42 | employee => 'Test::DBIx::Class::Example::Schema::Result::Person::Employee', | ||
| 43 | { | ||
| 44 | 'foreign.employee_id' => 'self.person_id', | ||
| 45 | }, | ||
| 46 | ); | ||
| 47 | |||
| 48 | 15 | __PACKAGE__->might_have( | |
| 49 | artist => 'Test::DBIx::Class::Example::Schema::Result::Person::Artist', | ||
| 50 | { | ||
| 51 | 'foreign.artist_id' => 'self.person_id', | ||
| 52 | }, | ||
| 53 | ); | ||
| 54 | } 1 | ||
| 55 | |||
| 56 | 15 | __END__ | |