summaryrefslogtreecommitdiffstats
path: root/modules-available/locationinfo/install.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2019-03-07 13:29:48 +0100
committerSimon Rettberg2019-03-07 13:29:48 +0100
commit35078669abfbe296b578b3f131a30dcb38ed99f5 (patch)
tree2b1ee1010ce9605007bf0cc95e80ed9767843212 /modules-available/locationinfo/install.inc.php
parent[locationinfo] Fix form<->button relation (delete, check, etc.) (diff)
downloadslx-admin-35078669abfbe296b578b3f131a30dcb38ed99f5.tar.gz
slx-admin-35078669abfbe296b578b3f131a30dcb38ed99f5.tar.xz
slx-admin-35078669abfbe296b578b3f131a30dcb38ed99f5.zip
[locationinfo] Add error log for backends
Diffstat (limited to 'modules-available/locationinfo/install.inc.php')
-rw-r--r--modules-available/locationinfo/install.inc.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/modules-available/locationinfo/install.inc.php b/modules-available/locationinfo/install.inc.php
index fc02ed76..7e58315b 100644
--- a/modules-available/locationinfo/install.inc.php
+++ b/modules-available/locationinfo/install.inc.php
@@ -35,6 +35,16 @@ $t3 = $res[] = tableCreate('locationinfo_panel', "
KEY `panelname` (`panelname`)
");
+// 2019-03-06: Add logging table
+$res[] = tableCreate('locationinfo_backendlog', "
+ `logid` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+ `serverid` int(10) UNSIGNED NOT NULL,
+ `dateline` int(10) UNSIGNED NOT NULL,
+ `message` varchar(500) NOT NULL,
+ PRIMARY KEY (`logid`),
+ KEY (`serverid`)
+");
+
// Update
if ($t1 === UPDATE_NOOP) {
@@ -89,6 +99,13 @@ if (!tableHasColumn('locationinfo_locationconfig', 'lastuse')) {
$res[] = UPDATE_DONE;
}
+// 2019-03-06: Add logging table constraint
+if (tableGetConstraints('locationinfo_backendlog', 'serverid',
+ 'locationinfo_coursebackend', 'serverid') === false) {
+ $res[] = tableAddConstraint('locationinfo_backendlog', 'serverid',
+ 'locationinfo_coursebackend', 'serverid', 'ON UPDATE CASCADE ON DELETE CASCADE');
+}
+
// Create response for browser
if (in_array(UPDATE_RETRY, $res)) {