summaryrefslogtreecommitdiffstats
path: root/modules-available/locationinfo/install.inc.php
diff options
context:
space:
mode:
authorJannik Schönartz2017-02-16 16:33:48 +0100
committerJannik Schönartz2017-02-16 16:33:48 +0100
commit835b4055563f8a0b34d4bd5af3a405af370381a3 (patch)
tree514f12d87e909b471f3edef672e2d549287ae076 /modules-available/locationinfo/install.inc.php
parentRemoved hidden from the Insert into's Default 0 should be insertet automaticl... (diff)
downloadslx-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/locationinfo/install.inc.php')
-rw-r--r--modules-available/locationinfo/install.inc.php40
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) {