summaryrefslogtreecommitdiffstats
path: root/modules-available
diff options
context:
space:
mode:
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);