From 35078669abfbe296b578b3f131a30dcb38ed99f5 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 7 Mar 2019 13:29:48 +0100 Subject: [locationinfo] Add error log for backends --- modules-available/locationinfo/install.inc.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'modules-available/locationinfo/install.inc.php') 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)) { -- cgit v1.2.3-55-g7522