diff options
author | Simon Rettberg | 2016-11-25 18:01:54 +0100 |
---|---|---|
committer | Simon Rettberg | 2016-11-25 18:01:54 +0100 |
commit | ef91d813d0d4abf021e0fbb20ac41cd9090a8b9f (patch) | |
tree | ba37dd48510e639d006a0d6fd5d1c935a6fba828 /modules-available/locationinfo/install.inc.php | |
parent | Settings added. All settings can be configured now in the slx-admin panel. It... (diff) | |
download | slx-admin-ef91d813d0d4abf021e0fbb20ac41cd9090a8b9f.tar.gz slx-admin-ef91d813d0d4abf021e0fbb20ac41cd9090a8b9f.tar.xz slx-admin-ef91d813d0d4abf021e0fbb20ac41cd9090a8b9f.zip |
[locationinfo] Add upgrade path to install.inc.php
Diffstat (limited to 'modules-available/locationinfo/install.inc.php')
-rw-r--r-- | modules-available/locationinfo/install.inc.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/modules-available/locationinfo/install.inc.php b/modules-available/locationinfo/install.inc.php index 86f3f851..f4eaee1f 100644 --- a/modules-available/locationinfo/install.inc.php +++ b/modules-available/locationinfo/install.inc.php @@ -13,6 +13,22 @@ $res[] = tableCreate('location_info', ' // Create response for browser +if (!tableHasColumn('location_info', 'config')) { + $ret = Database::exec("ALTER TABLE `location_info` ADD `config` VARCHAR(2000) NOT NULL DEFAULT '' AFTER `openingtime`"); + if ($ret === false) { + finalResponse(UPDATE_FAILED, 'Adding config to location_info failed: ' . Database::lastError()); + } + $res[] = UPDATE_DONE; +} + +if (!tableHasColumn('location_info', 'calendar')) { + $ret = Database::exec("ALTER TABLE `location_info` ADD `calendar` VARCHAR(2000) NOT NULL DEFAULT '' AFTER `config`"); + if ($ret === false) { + finalResponse(UPDATE_FAILED, 'Adding calendar to location_info failed: ' . Database::lastError()); + } + $res[] = UPDATE_DONE; +} + if (in_array(UPDATE_DONE, $res)) { finalResponse(UPDATE_DONE, 'Tables created successfully'); } |