#949 replace other occurances of now() with LOCALTIMESTAMP
This commit is contained in:
@@ -120,7 +120,7 @@ post '/login' => sub {
|
||||
event => (sprintf 'Login (%s)', ($api ? 'API' : 'WebUI')),
|
||||
details => param('return_url'),
|
||||
});
|
||||
$user->update({ last_on => \'now()' });
|
||||
$user->update({ last_on => \'LOCALTIMESTAMP' });
|
||||
|
||||
if ($api) {
|
||||
# from the internals of Dancer::Plugin::Auth::Extensible
|
||||
|
||||
@@ -59,7 +59,7 @@ ajax '/ajax/control/admin/nodemonitor/update' => require_role admin => sub {
|
||||
active => (param('active') ? \'true' : \'false'),
|
||||
why => param('why'),
|
||||
cc => param('cc'),
|
||||
date => \'now()',
|
||||
date => \'LOCALTIMESTAMP',
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
@@ -44,7 +44,7 @@ ajax '/ajax/control/admin/pseudodevice/add' => require_role admin => sub {
|
||||
os => 'netdisco',
|
||||
os_ver => pretty_version($App::Netdisco::VERSION, 3),
|
||||
layers => param('layers'),
|
||||
last_discover => \'now()',
|
||||
last_discover => \'LOCALTIMESTAMP',
|
||||
is_pseudo => \'true',
|
||||
});
|
||||
return unless $device;
|
||||
@@ -101,7 +101,7 @@ ajax '/ajax/control/admin/pseudodevice/update' => require_role admin => sub {
|
||||
$device->update({layers => param('layers')});
|
||||
|
||||
# and update last_discover, since device properties changed
|
||||
$device->update({last_discover => \'now()'});
|
||||
$device->update({last_discover => \'LOCALTIMESTAMP'});
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ get '/ajax/content/report/ipinventory' => require_login sub {
|
||||
'dns',
|
||||
\'true AS active',
|
||||
\'false AS node',
|
||||
\qq/replace( date_trunc( 'minute', age( now(), device.last_discover ) ) ::text, 'mon', 'month') AS age/,
|
||||
\qq/replace( date_trunc( 'minute', age( LOCALTIMESTAMP, device.last_discover ) ) ::text, 'mon', 'month') AS age/,
|
||||
'device.vendor',
|
||||
\'null AS nbname',
|
||||
|
||||
@@ -91,7 +91,7 @@ get '/ajax/content/report/ipinventory' => require_login sub {
|
||||
{ join => ['oui', 'netbios'],
|
||||
columns => [qw( ip mac time_first time_last dns active)],
|
||||
'+select' => [ \'true AS node',
|
||||
\qq/replace( date_trunc( 'minute', age( now(), me.time_last ) ) ::text, 'mon', 'month') AS age/,
|
||||
\qq/replace( date_trunc( 'minute', age( LOCALTIMESTAMP, me.time_last ) ) ::text, 'mon', 'month') AS age/,
|
||||
'oui.company',
|
||||
'netbios.nbname',
|
||||
],
|
||||
@@ -107,7 +107,7 @@ get '/ajax/content/report/ipinventory' => require_login sub {
|
||||
\'null AS dns',
|
||||
'active',
|
||||
\'true AS node',
|
||||
\qq/replace( date_trunc( 'minute', age( now(), time_last ) ) ::text, 'mon', 'month') AS age/,
|
||||
\qq/replace( date_trunc( 'minute', age( LOCALTIMESTAMP, time_last ) ) ::text, 'mon', 'month') AS age/,
|
||||
'oui.company',
|
||||
'nbname'
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user