summaryrefslogtreecommitdiffstats
path: root/modules-available
diff options
context:
space:
mode:
authorChristian Hofmaier2018-03-27 15:07:53 +0200
committerChristian Hofmaier2018-03-27 15:07:53 +0200
commit9e89edde9bccf632f18ff17fd80f949c491633ba (patch)
treef1fab4ba31eca795dfee7e2ecf18e84fcf22a06e /modules-available
parent[usb-lock-off] use install.php only once instead of twice to make it work... ... (diff)
downloadslx-admin-9e89edde9bccf632f18ff17fd80f949c491633ba.tar.gz
slx-admin-9e89edde9bccf632f18ff17fd80f949c491633ba.tar.xz
slx-admin-9e89edde9bccf632f18ff17fd80f949c491633ba.zip
[usb-lock-off] use install.php only once without overhead... DONE (for real)
Diffstat (limited to 'modules-available')
-rw-r--r--modules-available/usblockoff/install.inc.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules-available/usblockoff/install.inc.php b/modules-available/usblockoff/install.inc.php
index 31f31003..dda0ac35 100644
--- a/modules-available/usblockoff/install.inc.php
+++ b/modules-available/usblockoff/install.inc.php
@@ -56,8 +56,10 @@ if ($t4 === UPDATE_DONE) {
$res[] = tableAddConstraint("usblockoff_hw", "hwid", "statistic_hw", "hwid", "ON DELETE CASCADE");
// TODO: Works, as the one above already forces retry. How to write it in tableAddConstraint ?
-$ret = Database::exec('ALTER TABLE `usblockoff_hw_prop`
+if ($t2 === UPDATE_DONE) {
+ $ret = Database::exec('ALTER TABLE `usblockoff_hw_prop`
ADD CONSTRAINT `usblockoff_hw__prop_ibfk_1` FOREIGN KEY (`hwid`, `serial`) REFERENCES `usblockoff_hw` (`hwid`, `serial`) ON DELETE CASCADE');
+}
responseFromArray($res);