summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2019-01-02 15:01:51 +0100
committerSimon Rettberg2019-01-02 15:01:51 +0100
commita27ba66b59fbbdccd1679bcda77a8acb2f41a5c5 (patch)
tree95092ddc57547a8c7788a76639561e4bdb4332a7
parentMerge branch 'master' into ipxe (diff)
downloadslx-admin-a27ba66b59fbbdccd1679bcda77a8acb2f41a5c5.tar.gz
slx-admin-a27ba66b59fbbdccd1679bcda77a8acb2f41a5c5.tar.xz
slx-admin-a27ba66b59fbbdccd1679bcda77a8acb2f41a5c5.zip
[serversetup-bwlp] Add column to override default menuentry of location
-rw-r--r--modules-available/serversetup-bwlp/install.inc.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/modules-available/serversetup-bwlp/install.inc.php b/modules-available/serversetup-bwlp/install.inc.php
index 8814bb7c..67d6693f 100644
--- a/modules-available/serversetup-bwlp/install.inc.php
+++ b/modules-available/serversetup-bwlp/install.inc.php
@@ -40,8 +40,10 @@ $res[] = tableCreate('serversetup_menuentry', "
$res[] = tableCreate('serversetup_menu_location', '
`menuid` int(11) NOT NULL,
`locationid` int(11) NOT NULL,
+ `defaultentryid` int(11) DEFAULT NULL,
PRIMARY KEY (`menuid`,`locationid`),
- UNIQUE `locationid` (`locationid`)
+ UNIQUE `locationid` (`locationid`),
+ KEY `defaultentryid` (`defaultentryid`)
');
$res[] = tableCreate('serversetup_localboot', "
@@ -50,6 +52,15 @@ $res[] = tableCreate('serversetup_localboot', "
PRIMARY KEY (`systemmodel`)
");
+// Add defaultentry override column
+if (!tableHasColumn('serversetup_menu_location', 'defaultentryid')) {
+ if (Database::exec('ALTER TABLE serversetup_menu_location ADD COLUMN `defaultentryid` int(11) DEFAULT NULL')) {
+ $res[] = UPDATE_DONE;
+ } else {
+ $res[] = UPDATE_FAILED;
+ }
+}
+
$res[] = tableAddConstraint('serversetup_menu', 'defaultentryid', 'serversetup_menuentry', 'menuentryid',
'ON DELETE SET NULL');
@@ -62,6 +73,9 @@ $res[] = tableAddConstraint('serversetup_menuentry', 'menuid', 'serversetup_menu
$res[] = tableAddConstraint('serversetup_menu_location', 'menuid', 'serversetup_menu', 'menuid',
'ON UPDATE CASCADE ON DELETE CASCADE');
+$res[] = tableAddConstraint('serversetup_menu_location', 'defaultentryid', 'serversetup_menuentry', 'menuentryid',
+ 'ON UPDATE CASCADE ON DELETE SET NULL');
+
if (Module::get('location') !== false) {
if (!tableExists('location')) {
$res[] = UPDATE_RETRY;