tidy util code

This commit is contained in:
Oliver Gorwits
2019-03-20 15:05:10 +00:00
parent 4192271e4f
commit 9ef2407225
2 changed files with 24 additions and 57 deletions

View File

@@ -15,30 +15,35 @@ __PACKAGE__->add_columns(
"mac",
{ data_type => "macaddr", is_nullable => 0,
extra => { descr => 'MAC address' } },
"ip",
{ data_type => "inet", is_nullable => 0,
extra => { descr => 'IP address' } },
"dns",
{ data_type => "text", is_nullable => 1,
extra => { descr => 'FQDN of the node' } },
"active",
{ data_type => "boolean", is_nullable => 1,
extra => { descr => 'Whether the entry is still "fresh"' } },
"time_first",
{
data_type => "timestamp",
default_value => \"current_timestamp",
is_nullable => 1,
original => { default_value => \"now()" },
extra => { hide_from_api => 1 },
extra => { descr => 'When first seen on the network' },
},
"time_last",
{
data_type => "timestamp",
default_value => \"current_timestamp",
is_nullable => 1,
original => { default_value => \"now()" },
extra => { hide_from_api => 1 },
extra => { descr => 'When last seen on the network' },
},
);
__PACKAGE__->set_primary_key("mac", "ip");