summaryrefslogtreecommitdiffstats
path: root/modules-available/locationinfo/install.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2017-04-13 17:40:11 +0200
committerSimon Rettberg2017-04-13 17:40:11 +0200
commitea8a7fdbe9b2594778398f1b83cbb3ef17951ad1 (patch)
tree6b4aa03d912ac515c8b299b9282efccff3a46591 /modules-available/locationinfo/install.inc.php
parent[locationinfo] Two column view for location settings (for md and lg) (diff)
downloadslx-admin-ea8a7fdbe9b2594778398f1b83cbb3ef17951ad1.tar.gz
slx-admin-ea8a7fdbe9b2594778398f1b83cbb3ef17951ad1.tar.xz
slx-admin-ea8a7fdbe9b2594778398f1b83cbb3ef17951ad1.zip
[locationinfo] install.inc.php: Fix upgrade order
Diffstat (limited to 'modules-available/locationinfo/install.inc.php')
-rw-r--r--modules-available/locationinfo/install.inc.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/modules-available/locationinfo/install.inc.php b/modules-available/locationinfo/install.inc.php
index 88d69d3a..659dec8f 100644
--- a/modules-available/locationinfo/install.inc.php
+++ b/modules-available/locationinfo/install.inc.php
@@ -2,6 +2,7 @@
$res = array();
+// TODO: serverid NULL, constraint to serverlist on delete set NULL
$res[] = tableCreate('location_info', '
`locationid` INT(11) NOT NULL,
`serverid` INT(11) NOT NULL,
@@ -14,6 +15,7 @@ $res[] = tableCreate('location_info', '
PRIMARY KEY (`locationid`)
');
+// TODO: KEY `servername` (`servername`)
$res[] = tableCreate('setting_location_info', '
`serverid` int(10) NOT NULL AUTO_INCREMENT,
`servername` VARCHAR(2000) NOT NULL,
@@ -25,18 +27,19 @@ $res[] = tableCreate('setting_location_info', '
');
// Create response for browser
-if (!tableHasColumn('setting_location_info', 'error')) {
- $ret = Database::exec("ALTER TABLE `setting_location_info` ADD `error` VARCHAR(2000) AFTER `credentials`");
+
+if (!tableHasColumn('setting_location_info', 'credentials')) {
+ $ret = Database::exec("ALTER TABLE `setting_location_info` ADD `credentials` VARCHAR(2000) AFTER `servertype`");
if ($ret === false) {
- finalResponse(UPDATE_FAILED, 'Adding column error failed: ' . Database::lastError());
+ finalResponse(UPDATE_FAILED, 'Adding column credentials failed: ' . Database::lastError());
}
$res[] = UPDATE_DONE;
}
-if (!tableHasColumn('setting_location_info', 'credentials')) {
- $ret = Database::exec("ALTER TABLE `setting_location_info` ADD `credentials` VARCHAR(2000) AFTER `servertype`");
+if (!tableHasColumn('setting_location_info', 'error')) {
+ $ret = Database::exec("ALTER TABLE `setting_location_info` ADD `error` VARCHAR(2000) AFTER `credentials`");
if ($ret === false) {
- finalResponse(UPDATE_FAILED, 'Adding column credentials failed: ' . Database::lastError());
+ finalResponse(UPDATE_FAILED, 'Adding column error failed: ' . Database::lastError());
}
$res[] = UPDATE_DONE;
}