From c4bc0fdd0d9ea72feb2ca2c74a19d9d37588813b Mon Sep 17 00:00:00 2001 From: Jannik Schönartz Date: Fri, 9 Dec 2016 04:13:00 -0800 Subject: LocationInfo: Calendar informations get updated every 15 mins if there is a request. Added the settinglocationinfo column servername --- modules-available/locationinfo/install.inc.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (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 162f000c..e84bca6f 100644 --- a/modules-available/locationinfo/install.inc.php +++ b/modules-available/locationinfo/install.inc.php @@ -9,7 +9,8 @@ $res[] = tableCreate('location_info', ' `hidden` BOOLEAN NOT NULL DEFAULT 0, `openingtime` VARCHAR(2000) NOT NULL, `config` VARCHAR(2000) NOT NULL, - `calendar` VARCHAR(2000) NOT NULL, + `calendar` VARCHAR(2000) NOT NULL, + `lastcalendarupdate` INT(11) NOT NULL, PRIMARY KEY (`locationid`) '); @@ -65,6 +66,22 @@ if (!tableHasColumn('location_info', 'serverroomid')) { $res[] = UPDATE_DONE; } +if (!tableHasColumn('location_info', 'lastcalendarupdate')) { + $ret = Database::exec("ALTER TABLE `location_info` ADD `lastcalendarupdate` INT(11) NOT NULL AFTER `calendar`"); + if ($ret === false) { + finalResponse(UPDATE_FAILED, 'Adding lastcalendarupdate to location_info failed: ' . Database::lastError()); + } + $res[] = UPDATE_DONE; +} + +if (!tableHasColumn('setting_location_info', 'servername')) { + $ret = Database::exec("ALTER TABLE `setting_location_info` ADD `servername` INT(11) NOT NULL AFTER `serverid`"); + if ($ret === false) { + finalResponse(UPDATE_FAILED, 'Adding servername to setting_location_info failed: ' . Database::lastError()); + } + $res[] = UPDATE_DONE; +} + if (in_array(UPDATE_DONE, $res)) { finalResponse(UPDATE_DONE, 'Tables created successfully'); } -- cgit v1.2.3-55-g7522