Added device_id to eventlog table

This commit is contained in:
laf
2016-06-18 02:09:22 +01:00
parent f236741e49
commit 110dcae4c9
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),
'device_id' => ($device['device_id'] ? $device['device_id'] : 0),
'reference' => ($reference ? $reference : "NULL"),
'type' => ($type ? $type : "NULL"),
'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;