File: Network.pm

package info (click to toggle)
libdbix-class-inflatecolumn-ip-perl 0.02003-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch
  • size: 192 kB
  • ctags: 131
  • sloc: perl: 1,612; sql: 8; makefile: 2
file content (26 lines) | stat: -rw-r--r-- 564 bytes parent folder | download | duplicates (5)
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
package # hide from PAUSE
    DBICTest::Schema::Network;

use base qw/DBIx::Class/;

__PACKAGE__->load_components(qw/InflateColumn::IP Core/);
__PACKAGE__->table('network');

__PACKAGE__->add_columns(
    netname => {
        data_type   => 'text',
        is_nullable => 0,
    },
    address => {
        data_type   => 'varchar',
        size        => '18',
        is_nullable => 0,
        is_ip       => 1,
        ip_format   => 'cidr',
    }
);

__PACKAGE__->set_primary_key('netname');
__PACKAGE__->add_unique_constraint(address => [ qw/address/ ]);

1;