summaryrefslogtreecommitdiffstats
path: root/modules-available/locationinfo/install.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules-available/locationinfo/install.inc.php')
-rw-r--r--modules-available/locationinfo/install.inc.php21
1 files changed, 20 insertions, 1 deletions
diff --git a/modules-available/locationinfo/install.inc.php b/modules-available/locationinfo/install.inc.php
index f94c725e..162f000c 100644
--- a/modules-available/locationinfo/install.inc.php
+++ b/modules-available/locationinfo/install.inc.php
@@ -3,7 +3,9 @@
$res = array();
$res[] = tableCreate('location_info', '
- `locationid` INT(11) NOT NULL,
+ `locationid` INT(11) NOT NULL,
+ `serverid` INT(11) NOT NULL,
+ `serverroomid` INT(11) NOT NULL,
`hidden` BOOLEAN NOT NULL DEFAULT 0,
`openingtime` VARCHAR(2000) NOT NULL,
`config` VARCHAR(2000) NOT NULL,
@@ -13,6 +15,7 @@ $res[] = tableCreate('location_info', '
$res[] = tableCreate('setting_location_info', '
`serverid` int(10) NOT NULL AUTO_INCREMENT,
+ `servername` VARCHAR(2000) NOT NULL,
`serverurl` VARCHAR(2000) NOT NULL,
`servertype` VARCHAR(100) NOT NULL,
`login` VARCHAR(100) NOT NULL,
@@ -46,6 +49,22 @@ if (!tableHasColumn('location_info', 'calendar')) {
$res[] = UPDATE_DONE;
}
+if (!tableHasColumn('location_info', 'serverid')) {
+ $ret = Database::exec("ALTER TABLE `location_info` ADD `serverid` INT(11) NOT NULL AFTER `locationid`");
+ if ($ret === false) {
+ finalResponse(UPDATE_FAILED, 'Adding serverid to location_info failed: ' . Database::lastError());
+ }
+ $res[] = UPDATE_DONE;
+}
+
+if (!tableHasColumn('location_info', 'serverroomid')) {
+ $ret = Database::exec("ALTER TABLE `location_info` ADD `serverroomid` INT(11) NOT NULL AFTER `serverid`");
+ if ($ret === false) {
+ finalResponse(UPDATE_FAILED, 'Adding serverroomid to location_info failed: ' . Database::lastError());
+ }
+ $res[] = UPDATE_DONE;
+}
+
if (in_array(UPDATE_DONE, $res)) {
finalResponse(UPDATE_DONE, 'Tables created successfully');
}