Fix: Display Last Status Mail Sent for monitoring in admin panel correctly.
Naming of column is now also consistent.
This commit is contained in:
parent
c5938d3e13
commit
0e5c5e4e1e
2 changed files with 51 additions and 6 deletions
server/db/patches
45
server/db/patches/004_fix_up_column_name_for_monitoring.sql
Normal file
45
server/db/patches/004_fix_up_column_name_for_monitoring.sql
Normal file
|
@ -0,0 +1,45 @@
|
|||
-- sqlite only supports a limited subset of ALTER TABLE, thus this workaround
|
||||
|
||||
ALTER TABLE node_state RENAME TO tmp_node_state;
|
||||
|
||||
CREATE TABLE node_state (
|
||||
id INTEGER PRIMARY KEY,
|
||||
|
||||
mac VARCHAR(17) NOT NULL UNIQUE,
|
||||
|
||||
state VARCHAR(10) NOT NULL,
|
||||
last_seen DATETIME NOT NULL,
|
||||
|
||||
import_timestamp DATETIME NOT NULL,
|
||||
|
||||
last_status_mail_sent DATETIME,
|
||||
last_status_mail_type VARCHAR(20),
|
||||
|
||||
created_at DATETIME DEFAULT (strftime('%s','now')) NOT NULL,
|
||||
modified_at DATETIME DEFAULT (strftime('%s','now')) NOT NULL
|
||||
);
|
||||
|
||||
INSERT INTO node_state(
|
||||
id,
|
||||
mac,
|
||||
state,
|
||||
last_seen,
|
||||
import_timestamp,
|
||||
last_status_mail_sent,
|
||||
last_status_mail_type,
|
||||
created_at,
|
||||
modified_at
|
||||
)
|
||||
SELECT
|
||||
id,
|
||||
mac,
|
||||
state,
|
||||
last_seen,
|
||||
import_timestamp,
|
||||
last_status_mail_send,
|
||||
last_status_mail_type,
|
||||
created_at,
|
||||
modified_at
|
||||
FROM tmp_node_state;
|
||||
|
||||
DROP TABLE tmp_node_state;
|
Loading…
Add table
Add a link
Reference in a new issue