diff options
Diffstat (limited to 'modules-available/locationinfo/install.inc.php')
-rw-r--r-- | modules-available/locationinfo/install.inc.php | 19 |
1 files changed, 18 insertions, 1 deletions
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'); } |