summaryrefslogtreecommitdiffstats
path: root/modules-available/rebootcontrol/install.inc.php
diff options
context:
space:
mode:
authorChristian Hofmaier2021-03-16 20:03:58 +0100
committerChristian Hofmaier2021-03-16 20:03:58 +0100
commit834b95629832fc3735756727b6c7cb1826d0e9d8 (patch)
treeff465ef0063c59d92f8c77e89f15a2a7a2405977 /modules-available/rebootcontrol/install.inc.php
parent[sysconfig] yes -> true (diff)
downloadslx-admin-834b95629832fc3735756727b6c7cb1826d0e9d8.tar.gz
slx-admin-834b95629832fc3735756727b6c7cb1826d0e9d8.tar.xz
slx-admin-834b95629832fc3735756727b6c7cb1826d0e9d8.zip
[rebootcontrol] Handle scheduler overlaps
- Overlaps < 5 min are ignored, < 15 triggers reboot - Database: Make 1 line out of 2
Diffstat (limited to 'modules-available/rebootcontrol/install.inc.php')
-rw-r--r--modules-available/rebootcontrol/install.inc.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/modules-available/rebootcontrol/install.inc.php b/modules-available/rebootcontrol/install.inc.php
index 7d4382d0..008d26aa 100644
--- a/modules-available/rebootcontrol/install.inc.php
+++ b/modules-available/rebootcontrol/install.inc.php
@@ -55,4 +55,13 @@ $output[] = tableAddConstraint('reboot_subnet_x_subnet', 'dstid', 'reboot_subnet
$output[] = tableAddConstraint('reboot_scheduler', 'locationid', 'location', 'locationid',
'ON UPDATE CASCADE ON DELETE CASCADE');
+if (tableExists('reboot_scheduler')) {
+ Database::exec("ALTER TABLE `reboot_scheduler` DROP PRIMARY KEY , ADD PRIMARY KEY (`locationid`)");
+}
+if (tableHasColumn('reboot_scheduler', 'action')) {
+ Database::exec("ALTER TABLE `reboot_scheduler` MODIFY COLUMN `action` ENUM('wol', 'sd', 'rb')");
+}
+
+
+
responseFromArray($output); \ No newline at end of file