1use utf8;
2package App::Netdisco::DB::Result::DevicePortLog;
3
4
5use strict;
6use warnings;
7
8use base 'App::Netdisco::DB::Result';
9__PACKAGE__->table("device_port_log");
10__PACKAGE__->add_columns(
11  "id",
12  {
13    data_type         => "integer",
14    is_auto_increment => 1,
15    is_nullable       => 0,
16    sequence          => "device_port_log_id_seq",
17  },
18  "ip",
19  { data_type => "inet", is_nullable => 1 },
20  "port",
21  { data_type => "text", is_nullable => 1 },
22  "reason",
23  { data_type => "text", is_nullable => 1 },
24  "log",
25  { data_type => "text", is_nullable => 1 },
26  "username",
27  { data_type => "text", is_nullable => 1 },
28  "userip",
29  { data_type => "inet", is_nullable => 1 },
30  "action",
31  { data_type => "text", is_nullable => 1 },
32  "creation",
33  {
34    data_type     => "timestamp",
35    default_value => \"current_timestamp",
36    is_nullable   => 1,
37    original      => { default_value => \"now()" },
38  },
39);
40
41__PACKAGE__->set_primary_key("id");
42
43=head1 ADDITIONAL COLUMNS
44
45=head2 creation_stamp
46
47Formatted version of the C<creation> field, accurate to the second.
48
49The format is somewhat like ISO 8601 or RFC3339 but without the middle C<T>
50between the date stamp and time stamp. That is:
51
52 2012-02-06 12:49:23
53
54=cut
55
56sub creation_stamp  { return (shift)->get_column('creation_stamp')  }
57
581;
59