blib/lib/App/Netdisco/DB/Result/Topology.pm untested

filter: Statementstmt 0.0% 0 / 24 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod n/a totaltotal 0.0% 0 / 28 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 use utf8;
2 package App::Netdisco::DB::Result::Topology;
3  
4 use strict;
5 use warnings;
6  
7 use base 'App::Netdisco::DB::Result';
8  
9 __PACKAGE__->table("topology");
10  
11 __PACKAGE__->add_columns(
12 "dev1",
13 { data_type => "inet", is_nullable => 0 },
14 "port1",
15 { data_type => "text", is_nullable => 0 },
16 "dev2",
17 { data_type => "inet", is_nullable => 0 },
18 "port2",
19 { data_type => "text", is_nullable => 0 },
20 );
21  
22 __PACKAGE__->add_unique_constraint(['dev1','port1']);
23 __PACKAGE__->add_unique_constraint(['dev2','port2']);
24  
25 __PACKAGE__->belongs_to(
26 device1 => 'App::Netdisco::DB::Result::Device',
27 {'foreign.ip' => 'self.dev1'}
28 );
29  
30 __PACKAGE__->belongs_to(
31 device2 => 'App::Netdisco::DB::Result::Device',
32 {'foreign.ip' => 'self.dev2'}
33 );
34  
35 1;