From 9e89edde9bccf632f18ff17fd80f949c491633ba Mon Sep 17 00:00:00 2001 From: Christian Hofmaier Date: Tue, 27 Mar 2018 15:07:53 +0200 Subject: [usb-lock-off] use install.php only once without overhead... DONE (for real) --- modules-available/usblockoff/install.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'modules-available') 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); -- cgit v1.2.3-55-g7522