« blib/lib/App/Netdisco/DB/Result/DevicePortLog.pm
↑ Summary
blib/lib/App/Netdisco/DB/Result/DevicePortProperties.pm »
| 1 | use utf8; | ||
| 2 | package App::Netdisco::DB::Result::DevicePortPower; | ||
| 3 | |||
| 4 | |||
| 5 | use strict; | ||
| 6 | use warnings; | ||
| 7 | |||
| 8 | use 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 | |||
| 34 | Returns 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 | |||
| 44 | Returns the entry from the C<device_power> table for which this Power entry | ||
| 45 | applies. | ||
| 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 | |||
| 53 | 1; |