1use utf8; 2package App::Netdisco::DB::Result::DevicePortPower; 3 4 5use strict; 6use warnings; 7 8use base 'App::Netdisco::DB::Result'; 9__PACKAGE__->table("device_port_power"); 10__PACKAGE__->add_columns( 11 "ip", 12 { data_type => "inet", is_nullable => 0 }, 13 "port", 14 { data_type => "text", is_nullable => 0 }, 15 "module", 16 { data_type => "integer", is_nullable => 1 }, 17 "admin", 18 { data_type => "text", is_nullable => 1 }, 19 "status", 20 { data_type => "text", is_nullable => 1 }, 21 "class", 22 { data_type => "text", is_nullable => 1 }, 23 "power", 24 { data_type => "integer", is_nullable => 1 }, 25); 26__PACKAGE__->set_primary_key("port", "ip"); 27 28 29 30=head1 RELATIONSHIPS 31 32=head2 port 33 34Returns the entry from the C<port> table for which this Power entry applies. 35 36=cut 37 38__PACKAGE__->belongs_to( port => 'App::Netdisco::DB::Result::DevicePort', { 39 'foreign.ip' => 'self.ip', 'foreign.port' => 'self.port', 40}); 41 42=head2 device_module 43 44Returns the entry from the C<device_power> table for which this Power entry 45applies. 46 47=cut 48 49__PACKAGE__->belongs_to( device_module => 'App::Netdisco::DB::Result::DevicePower', { 50 'foreign.ip' => 'self.ip', 'foreign.module' => 'self.module', 51}); 52 531; 54