Merge pull request #3682 from laf/eventlog-device-id

Added device_id to eventlog table
This commit is contained in:
Daniel Preussker
2016-06-24 12:49:13 +00:00
committed by GitHub
2 changed files with 5 additions and 0 deletions

View File

@ -719,6 +719,7 @@ function log_event($text, $device = NULL, $type = NULL, $reference = NULL) {
} }
$insert = array('host' => ($device['device_id'] ? $device['device_id'] : 0), $insert = array('host' => ($device['device_id'] ? $device['device_id'] : 0),
'device_id' => ($device['device_id'] ? $device['device_id'] : 0),
'reference' => ($reference ? $reference : "NULL"), 'reference' => ($reference ? $reference : "NULL"),
'type' => ($type ? $type : "NULL"), 'type' => ($type ? $type : "NULL"),
'datetime' => array("NOW()"), 'datetime' => array("NOW()"),

4
sql-schema/118.sql Normal file
View File

@ -0,0 +1,4 @@
UPDATE dbSchema SET version = 118;
ALTER TABLE `eventlog` ADD `device_id` INT NOT NULL AFTER `host` ;
ALTER TABLE `eventlog` ADD INDEX ( `device_id` ) ;
UPDATE eventlog SET device_id=host WHERE device_id=0;