diff options
author | Jannik Schönartz | 2017-02-16 16:33:48 +0100 |
---|---|---|
committer | Jannik Schönartz | 2017-02-16 16:33:48 +0100 |
commit | 835b4055563f8a0b34d4bd5af3a405af370381a3 (patch) | |
tree | 514f12d87e909b471f3edef672e2d549287ae076 /modules-available | |
parent | Removed hidden from the Insert into's Default 0 should be insertet automaticl... (diff) | |
download | slx-admin-835b4055563f8a0b34d4bd5af3a405af370381a3.tar.gz slx-admin-835b4055563f8a0b34d4bd5af3a405af370381a3.tar.xz slx-admin-835b4055563f8a0b34d4bd5af3a405af370381a3.zip |
Changed some default values in db. Run install.php is needed.
Diffstat (limited to 'modules-available')
-rw-r--r-- | modules-available/locationinfo/install.inc.php | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/modules-available/locationinfo/install.inc.php b/modules-available/locationinfo/install.inc.php index bcd6b1ec..4494ffdd 100644 --- a/modules-available/locationinfo/install.inc.php +++ b/modules-available/locationinfo/install.inc.php @@ -7,10 +7,10 @@ $res[] = tableCreate('location_info', ' `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, - `calendar` VARCHAR(2000) NOT NULL, - `lastcalendarupdate` INT(11) NOT NULL, + `openingtime` VARCHAR(2000), + `config` VARCHAR(2000), + `calendar` VARCHAR(2000), + `lastcalendarupdate` INT(11) NOT NULL DEFAULT 0, PRIMARY KEY (`locationid`) '); @@ -26,6 +26,38 @@ $res[] = tableCreate('setting_location_info', ' // Create response for browser +if (tableHasColumn('location_info', 'openingtime')) { + $ret = Database::exec("ALTER TABLE `location_info` MODIFY openingtime VARCHAR(2000)"); + if ($ret === false) { + finalResponse(UPDATE_FAILED, 'Updateing column openingtime failed: ' . Database::lastError()); + } + $res[] = UPDATE_DONE; +} + +if (tableHasColumn('location_info', 'config')) { + $ret = Database::exec("ALTER TABLE `location_info` MODIFY config VARCHAR(2000)"); + if ($ret === false) { + finalResponse(UPDATE_FAILED, 'Updateing column config failed: ' . Database::lastError()); + } + $res[] = UPDATE_DONE; +} + +if (tableHasColumn('location_info', 'calendar')) { + $ret = Database::exec("ALTER TABLE `location_info` MODIFY calendar VARCHAR(2000)"); + if ($ret === false) { + finalResponse(UPDATE_FAILED, 'Updateing column calendar failed: ' . Database::lastError()); + } + $res[] = UPDATE_DONE; +} + +if (tableHasColumn('location_info', 'lastcalendarupdate')) { + $ret = Database::exec("ALTER TABLE `location_info` MODIFY lastcalendarupdate INT(11) NOT NULL DEFAULT 0"); + if ($ret === false) { + finalResponse(UPDATE_FAILED, 'Updateing column lastcalendarupdate failed: ' . Database::lastError()); + } + $res[] = UPDATE_DONE; +} + if(tableExists('locationinfo')) { $ret = Database::exec("DROP TABLE `locationinfo`"); if ($ret === false) { |