#949 inconsistencies in time values due to time zone handling

This commit is contained in:
Oliver Gorwits
2023-03-03 15:01:06 +00:00
parent 9ade0b21dd
commit 1d00ebc91e
22 changed files with 111 additions and 56 deletions

View File

@@ -11,7 +11,7 @@ __PACKAGE__->load_namespaces(
); );
our # try to hide from kwalitee our # try to hide from kwalitee
$VERSION = 77; # schema version used for upgrades, keep as integer $VERSION = 78; # schema version used for upgrades, keep as integer
use Path::Class; use Path::Class;
use File::ShareDir 'dist_dir'; use File::ShareDir 'dist_dir';

View File

@@ -18,9 +18,9 @@ __PACKAGE__->add_columns(
"entered", "entered",
{ {
data_type => "timestamp", data_type => "timestamp",
default_value => \"current_timestamp", default_value => \"LOCALTIMESTAMP",
is_nullable => 1, is_nullable => 1,
original => { default_value => \"now()" }, original => { default_value => \"LOCALTIMESTAMP" },
}, },
"started", "started",
{ data_type => "timestamp", is_nullable => 1 }, { data_type => "timestamp", is_nullable => 1 },

View File

@@ -17,9 +17,9 @@ __PACKAGE__->add_columns(
"creation", "creation",
{ {
data_type => "timestamp", data_type => "timestamp",
default_value => \"current_timestamp", default_value => \"LOCALTIMESTAMP",
is_nullable => 1, is_nullable => 1,
original => { default_value => \"now()" }, original => { default_value => \"LOCALTIMESTAMP" },
}, },
"dns", "dns",
{ data_type => "text", is_nullable => 1 }, { data_type => "text", is_nullable => 1 },

View File

@@ -23,9 +23,9 @@ __PACKAGE__->add_columns(
"creation", "creation",
{ {
data_type => "timestamp", data_type => "timestamp",
default_value => \"current_timestamp", default_value => \"LOCALTIMESTAMP",
is_nullable => 1, is_nullable => 1,
original => { default_value => \"now()" }, original => { default_value => \"LOCALTIMESTAMP" },
}, },
); );
__PACKAGE__->set_primary_key("ip", "alias"); __PACKAGE__->set_primary_key("ip", "alias");

View File

@@ -39,9 +39,9 @@ __PACKAGE__->add_columns(
"creation", "creation",
{ {
data_type => "timestamp", data_type => "timestamp",
default_value => \"current_timestamp", default_value => \"LOCALTIMESTAMP",
is_nullable => 1, is_nullable => 1,
original => { default_value => \"now()" }, original => { default_value => \"LOCALTIMESTAMP" },
}, },
"last_discover", "last_discover",
{ data_type => "timestamp", is_nullable => 1 }, { data_type => "timestamp", is_nullable => 1 },

View File

@@ -19,9 +19,9 @@ __PACKAGE__->add_columns(
"creation", "creation",
{ {
data_type => "timestamp", data_type => "timestamp",
default_value => \"current_timestamp", default_value => \"LOCALTIMESTAMP",
is_nullable => 1, is_nullable => 1,
original => { default_value => \"now()" }, original => { default_value => \"LOCALTIMESTAMP" },
}, },
"descr", "descr",
{ data_type => "text", is_nullable => 1 }, { data_type => "text", is_nullable => 1 },

View File

@@ -32,9 +32,9 @@ __PACKAGE__->add_columns(
"creation", "creation",
{ {
data_type => "timestamp", data_type => "timestamp",
default_value => \"current_timestamp", default_value => \"LOCALTIMESTAMP",
is_nullable => 1, is_nullable => 1,
original => { default_value => \"now()" }, original => { default_value => \"LOCALTIMESTAMP" },
}, },
); );

View File

@@ -21,16 +21,16 @@ __PACKAGE__->add_columns(
"creation", "creation",
{ {
data_type => "timestamp", data_type => "timestamp",
default_value => \"current_timestamp", default_value => \"LOCALTIMESTAMP",
is_nullable => 1, is_nullable => 1,
original => { default_value => \"now()" }, original => { default_value => \"LOCALTIMESTAMP" },
}, },
"last_discover", "last_discover",
{ {
data_type => "timestamp", data_type => "timestamp",
default_value => \"current_timestamp", default_value => \"LOCALTIMESTAMP",
is_nullable => 1, is_nullable => 1,
original => { default_value => \"now()" }, original => { default_value => \"LOCALTIMESTAMP" },
}, },
"vlantype", "vlantype",
{ data_type => "text", is_nullable => 1 }, { data_type => "text", is_nullable => 1 },

View File

@@ -17,16 +17,16 @@ __PACKAGE__->add_columns(
"creation", "creation",
{ {
data_type => "timestamp", data_type => "timestamp",
default_value => \"current_timestamp", default_value => \"LOCALTIMESTAMP",
is_nullable => 1, is_nullable => 1,
original => { default_value => \"now()" }, original => { default_value => \"LOCALTIMESTAMP" },
}, },
"last_discover", "last_discover",
{ {
data_type => "timestamp", data_type => "timestamp",
default_value => \"current_timestamp", default_value => \"LOCALTIMESTAMP",
is_nullable => 1, is_nullable => 1,
original => { default_value => \"now()" }, original => { default_value => \"LOCALTIMESTAMP" },
}, },
); );
__PACKAGE__->set_primary_key("ip", "vlan"); __PACKAGE__->set_primary_key("ip", "vlan");

View File

@@ -18,9 +18,9 @@ __PACKAGE__->add_columns(
"creation", "creation",
{ {
data_type => "timestamp", data_type => "timestamp",
default_value => \"current_timestamp", default_value => \"LOCALTIMESTAMP",
is_nullable => 1, is_nullable => 1,
original => { default_value => \"now()" }, original => { default_value => \"LOCALTIMESTAMP" },
}, },
"class", "class",
{ data_type => "text", is_nullable => 1 }, { data_type => "text", is_nullable => 1 },

View File

@@ -23,23 +23,23 @@ __PACKAGE__->add_columns(
"time_first", "time_first",
{ {
data_type => "timestamp", data_type => "timestamp",
default_value => \"current_timestamp", default_value => \"LOCALTIMESTAMP",
is_nullable => 1, is_nullable => 1,
original => { default_value => \"now()" }, original => { default_value => \"LOCALTIMESTAMP" },
}, },
"time_recent", "time_recent",
{ {
data_type => "timestamp", data_type => "timestamp",
default_value => \"current_timestamp", default_value => \"LOCALTIMESTAMP",
is_nullable => 1, is_nullable => 1,
original => { default_value => \"now()" }, original => { default_value => \"LOCALTIMESTAMP" },
}, },
"time_last", "time_last",
{ {
data_type => "timestamp", data_type => "timestamp",
default_value => \"current_timestamp", default_value => \"LOCALTIMESTAMP",
is_nullable => 1, is_nullable => 1,
original => { default_value => \"now()" }, original => { default_value => \"LOCALTIMESTAMP" },
}, },
"vlan", "vlan",
{ data_type => "text", is_nullable => 0, default_value => '0' }, { data_type => "text", is_nullable => 0, default_value => '0' },

View File

@@ -21,16 +21,16 @@ __PACKAGE__->add_columns(
"time_first", "time_first",
{ {
data_type => "timestamp", data_type => "timestamp",
default_value => \"current_timestamp", default_value => \"LOCALTIMESTAMP",
is_nullable => 1, is_nullable => 1,
original => { default_value => \"now()" }, original => { default_value => \"LOCALTIMESTAMP" },
}, },
"time_last", "time_last",
{ {
data_type => "timestamp", data_type => "timestamp",
default_value => \"current_timestamp", default_value => \"LOCALTIMESTAMP",
is_nullable => 1, is_nullable => 1,
original => { default_value => \"now()" }, original => { default_value => \"LOCALTIMESTAMP" },
}, },
); );
__PACKAGE__->set_primary_key("mac", "ip"); __PACKAGE__->set_primary_key("mac", "ip");

View File

@@ -21,9 +21,9 @@ __PACKAGE__->add_columns(
"date", "date",
{ {
data_type => "timestamp", data_type => "timestamp",
default_value => \"current_timestamp", default_value => \"LOCALTIMESTAMP",
is_nullable => 1, is_nullable => 1,
original => { default_value => \"now()" }, original => { default_value => \"LOCALTIMESTAMP" },
}, },
); );
__PACKAGE__->set_primary_key("mac"); __PACKAGE__->set_primary_key("mac");

View File

@@ -27,16 +27,16 @@ __PACKAGE__->add_columns(
"time_first", "time_first",
{ {
data_type => "timestamp", data_type => "timestamp",
default_value => \"current_timestamp", default_value => \"LOCALTIMESTAMP",
is_nullable => 1, is_nullable => 1,
original => { default_value => \"now()" }, original => { default_value => \"LOCALTIMESTAMP" },
}, },
"time_last", "time_last",
{ {
data_type => "timestamp", data_type => "timestamp",
default_value => \"current_timestamp", default_value => \"LOCALTIMESTAMP",
is_nullable => 1, is_nullable => 1,
original => { default_value => \"now()" }, original => { default_value => \"LOCALTIMESTAMP" },
}, },
); );
__PACKAGE__->set_primary_key("mac"); __PACKAGE__->set_primary_key("mac");

View File

@@ -33,9 +33,9 @@ __PACKAGE__->add_columns(
"time_last", "time_last",
{ {
data_type => "timestamp", data_type => "timestamp",
default_value => \"current_timestamp", default_value => \"LOCALTIMESTAMP",
is_nullable => 1, is_nullable => 1,
original => { default_value => \"now()" }, original => { default_value => \"LOCALTIMESTAMP" },
}, },
"ssid", "ssid",
{ data_type => "text", is_nullable => 0, default_value => '' }, { data_type => "text", is_nullable => 0, default_value => '' },

View File

@@ -21,9 +21,9 @@ __PACKAGE__->add_columns(
"creation", "creation",
{ {
data_type => "timestamp", data_type => "timestamp",
default_value => \"current_timestamp", default_value => \"LOCALTIMESTAMP",
is_nullable => 1, is_nullable => 1,
original => { default_value => \"now()" }, original => { default_value => \"LOCALTIMESTAMP" },
}, },
); );

View File

@@ -13,9 +13,9 @@ __PACKAGE__->add_columns(
"creation", "creation",
{ {
data_type => "timestamp", data_type => "timestamp",
default_value => \"current_timestamp", default_value => \"LOCALTIMESTAMP",
is_nullable => 1, is_nullable => 1,
original => { default_value => \"now()" }, original => { default_value => \"LOCALTIMESTAMP" },
}, },
"a_session", "a_session",
{ data_type => "text", is_nullable => 1 }, { data_type => "text", is_nullable => 1 },

View File

@@ -13,16 +13,16 @@ __PACKAGE__->add_columns(
"creation", "creation",
{ {
data_type => "timestamp", data_type => "timestamp",
default_value => \"current_timestamp", default_value => \"LOCALTIMESTAMP",
is_nullable => 1, is_nullable => 1,
original => { default_value => \"now()" }, original => { default_value => \"LOCALTIMESTAMP" },
}, },
"last_discover", "last_discover",
{ {
data_type => "timestamp", data_type => "timestamp",
default_value => \"current_timestamp", default_value => \"LOCALTIMESTAMP",
is_nullable => 1, is_nullable => 1,
original => { default_value => \"now()" }, original => { default_value => \"LOCALTIMESTAMP" },
}, },
); );
__PACKAGE__->set_primary_key("net"); __PACKAGE__->set_primary_key("net");

View File

@@ -19,9 +19,9 @@ __PACKAGE__->add_columns(
"creation", "creation",
{ {
data_type => "timestamp", data_type => "timestamp",
default_value => \"current_timestamp", default_value => \"LOCALTIMESTAMP",
is_nullable => 1, is_nullable => 1,
original => { default_value => \"now()" }, original => { default_value => \"LOCALTIMESTAMP" },
}, },
"last_on", "last_on",
{ data_type => "timestamp", is_nullable => 1 }, { data_type => "timestamp", is_nullable => 1 },

View File

@@ -26,9 +26,9 @@ __PACKAGE__->add_columns(
"creation", "creation",
{ {
data_type => "timestamp", data_type => "timestamp",
default_value => \"current_timestamp", default_value => \"LOCALTIMESTAMP",
is_nullable => 1, is_nullable => 1,
original => { default_value => \"now()" }, original => { default_value => \"LOCALTIMESTAMP" },
}, },
); );

View File

@@ -29,21 +29,21 @@ __PACKAGE__->add_columns(
"time_first", "time_first",
{ {
data_type => "timestamp", data_type => "timestamp",
default_value => \"current_timestamp", default_value => \"LOCALTIMESTAMP",
is_nullable => 1, is_nullable => 1,
original => { default_value => \"LOCALTIMESTAMP" }, original => { default_value => \"LOCALTIMESTAMP" },
}, },
"time_recent", "time_recent",
{ {
data_type => "timestamp", data_type => "timestamp",
default_value => \"current_timestamp", default_value => \"LOCALTIMESTAMP",
is_nullable => 1, is_nullable => 1,
original => { default_value => \"LOCALTIMESTAMP" }, original => { default_value => \"LOCALTIMESTAMP" },
}, },
"time_last", "time_last",
{ {
data_type => "timestamp", data_type => "timestamp",
default_value => \"current_timestamp", default_value => \"LOCALTIMESTAMP",
is_nullable => 1, is_nullable => 1,
original => { default_value => \"LOCALTIMESTAMP" }, original => { default_value => \"LOCALTIMESTAMP" },
}, },

View File

@@ -0,0 +1,55 @@
BEGIN;
ALTER TABLE admin ALTER entered SET DEFAULT LOCALTIMESTAMP;
ALTER TABLE device ALTER creation SET DEFAULT LOCALTIMESTAMP;
ALTER TABLE device_ip ALTER creation SET DEFAULT LOCALTIMESTAMP;
ALTER TABLE device_module ALTER creation SET DEFAULT LOCALTIMESTAMP;
ALTER TABLE device_port ALTER creation SET DEFAULT LOCALTIMESTAMP;
ALTER TABLE device_port_log ALTER creation SET DEFAULT LOCALTIMESTAMP;
ALTER TABLE device_port_vlan ALTER creation SET DEFAULT LOCALTIMESTAMP;
ALTER TABLE device_port_vlan ALTER last_discover SET DEFAULT LOCALTIMESTAMP;
ALTER TABLE device_vlan ALTER creation SET DEFAULT LOCALTIMESTAMP;
ALTER TABLE device_vlan ALTER last_discover SET DEFAULT LOCALTIMESTAMP;
ALTER TABLE log ALTER creation SET DEFAULT LOCALTIMESTAMP;
ALTER TABLE node ALTER time_first SET DEFAULT LOCALTIMESTAMP;
ALTER TABLE node ALTER time_recent SET DEFAULT LOCALTIMESTAMP;
ALTER TABLE node ALTER time_last SET DEFAULT LOCALTIMESTAMP;
ALTER TABLE node_ip ALTER time_first SET DEFAULT LOCALTIMESTAMP;
ALTER TABLE node_ip ALTER time_last SET DEFAULT LOCALTIMESTAMP;
ALTER TABLE node_monitor ALTER date SET DEFAULT LOCALTIMESTAMP;
ALTER TABLE node_nbt ALTER time_first SET DEFAULT LOCALTIMESTAMP;
ALTER TABLE node_nbt ALTER time_last SET DEFAULT LOCALTIMESTAMP;
ALTER TABLE node_wireless ALTER time_last SET DEFAULT LOCALTIMESTAMP;
ALTER TABLE process ALTER creation SET DEFAULT LOCALTIMESTAMP;
ALTER TABLE sessions ALTER creation SET DEFAULT LOCALTIMESTAMP;
ALTER TABLE subnets ALTER creation SET DEFAULT LOCALTIMESTAMP;
ALTER TABLE subnets ALTER last_discover SET DEFAULT LOCALTIMESTAMP;
ALTER TABLE users ALTER creation SET DEFAULT LOCALTIMESTAMP;
ALTER TABLE user_log ALTER creation SET DEFAULT LOCALTIMESTAMP;
COMMIT;