diff options
author | Jannik Schönartz | 2016-12-05 18:56:44 +0100 |
---|---|---|
committer | Jannik Schönartz | 2016-12-05 18:56:44 +0100 |
commit | a86d0225dc7768a629ce59c325a1dcc739122ef9 (patch) | |
tree | 3dcfbd03ea58d97a09515d7a4783a8aef761ff26 /modules-available/locationinfo/install.inc.php | |
parent | frontend: changed to backend changes, use media querrys, changed free seats f... (diff) | |
download | slx-admin-a86d0225dc7768a629ce59c325a1dcc739122ef9.tar.gz slx-admin-a86d0225dc7768a629ce59c325a1dcc739122ef9.tar.xz slx-admin-a86d0225dc7768a629ce59c325a1dcc739122ef9.zip |
Locationinfo: Added Servertable
Diffstat (limited to 'modules-available/locationinfo/install.inc.php')
-rw-r--r-- | modules-available/locationinfo/install.inc.php | 21 |
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'); } |