summaryrefslogtreecommitdiffstats
path: root/modules-available/syslog
diff options
context:
space:
mode:
Diffstat (limited to 'modules-available/syslog')
-rw-r--r--modules-available/syslog/install.inc.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/modules-available/syslog/install.inc.php b/modules-available/syslog/install.inc.php
index 539f2449..406a6cc6 100644
--- a/modules-available/syslog/install.inc.php
+++ b/modules-available/syslog/install.inc.php
@@ -2,7 +2,7 @@
$res = array();
-$res[] = tableCreate('clientlog', "
+$res[] = $tc = tableCreate('clientlog', "
`logid` int(10) unsigned NOT NULL AUTO_INCREMENT,
`dateline` int(10) unsigned NOT NULL,
`logtypeid` varchar(30) NOT NULL,
@@ -14,7 +14,7 @@ $res[] = tableCreate('clientlog', "
KEY `dateline` (`dateline`),
KEY `logtypeid` (`logtypeid`,`dateline`),
KEY `clientip` (`clientip`,`dateline`),
- KEY `machineuuid` (`machineuuid`,`dateline`)
+ KEY `machineuuid` (`machineuuid`,`logid`)
");
// Update path
@@ -29,6 +29,12 @@ if (!tableHasColumn('clientlog', 'machineuuid')) {
$res[] = UPDATE_DONE;
}
+// 2017-11-03: Create proper index for query in statistics module
+if ($tc !== UPDATE_DONE) {
+ Database::exec("ALTER TABLE `openslx`.`clientlog` DROP INDEX `machineuuid` ,
+ ADD INDEX `machineuuid` ( `machineuuid` , `logid` )");
+}
+
// Create response for browser
if (in_array(UPDATE_DONE, $res)) {