diff --git a/includes/functions.php b/includes/functions.php index 64a7748750..e0845036f5 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -719,6 +719,7 @@ function log_event($text, $device = NULL, $type = NULL, $reference = NULL) { } $insert = array('host' => ($device['device_id'] ? $device['device_id'] : 0), + 'device_id' => ($device['device_id'] ? $device['device_id'] : 0), 'reference' => ($reference ? $reference : "NULL"), 'type' => ($type ? $type : "NULL"), 'datetime' => array("NOW()"), diff --git a/sql-schema/118.sql b/sql-schema/118.sql new file mode 100644 index 0000000000..eb755d5e74 --- /dev/null +++ b/sql-schema/118.sql @@ -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;