File: Person.pm

package info (click to toggle)
libhtml-formfu-perl 0.09007-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 4,184 kB
  • sloc: perl: 13,186; makefile: 9; sql: 5
file content (50 lines) | stat: -rw-r--r-- 924 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package MyApp::Schema::Person;

use strict;
use warnings;

use base 'DBIx::Class';

__PACKAGE__->load_components(qw/ PK::Auto Core /);

__PACKAGE__->table("person");

__PACKAGE__->add_columns(
    "person_id",
    {   data_type   => "INT", 
        is_nullable => 0, 
        size        => 10, 
        extra => {
            unsigned => 1,
        },
    },
    "title",
    {   data_type   => "ENUM",
        is_nullable => 0,
        extra => {
            list => [qw/ Mr Mrs Miss /],
        },
    },
    "name",
    {   data_type   => "VARCHAR",
        is_nullable => 0,
        size        => 255,
    },
    "age",
    {   data_type   => "INT",
        is_nullable => 0,
        size        => 10,
        extra => {
            unsigned => 1,
        }
    }
);

__PACKAGE__->set_primary_key("person_id");

__PACKAGE__->might_have(
    dongle => 'Dongle',
    { 'foreign.person_id' => 'self.person_id' } );

1;