diff options
author | Simon Rettberg | 2017-04-07 14:47:44 +0200 |
---|---|---|
committer | Simon Rettberg | 2017-04-07 14:47:44 +0200 |
commit | 016ebfe0affc86e14115afe34d415bc58f9164b3 (patch) | |
tree | 647d7ae8108868ed3d21229820892aa53ae4c7a4 /modules-available/statistics/install.inc.php | |
parent | Merge branch 'statistics_reporting' (diff) | |
download | slx-admin-016ebfe0affc86e14115afe34d415bc58f9164b3.tar.gz slx-admin-016ebfe0affc86e14115afe34d415bc58f9164b3.tar.xz slx-admin-016ebfe0affc86e14115afe34d415bc58f9164b3.zip |
[statistics] Better errormsg in install, link to projectors added
Diffstat (limited to 'modules-available/statistics/install.inc.php')
-rw-r--r-- | modules-available/statistics/install.inc.php | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/modules-available/statistics/install.inc.php b/modules-available/statistics/install.inc.php index 5d8ce1bc..79346f99 100644 --- a/modules-available/statistics/install.inc.php +++ b/modules-available/statistics/install.inc.php @@ -201,16 +201,21 @@ if ($addTrigger) { } if ($machineHwCreate === UPDATE_DONE) { - $ret = true; $ret = Database::exec('ALTER TABLE `machine_x_hw` ADD CONSTRAINT `machine_x_hw_ibfk_1` FOREIGN KEY (`hwid`) REFERENCES `statistic_hw` (`hwid`) ON DELETE CASCADE, - ADD CONSTRAINT `machine_x_hw_ibfk_2` FOREIGN KEY (`machineuuid`) REFERENCES `machine` (`machineuuid`) ON DELETE CASCADE') && $ret; + ADD CONSTRAINT `machine_x_hw_ibfk_2` FOREIGN KEY (`machineuuid`) REFERENCES `machine` (`machineuuid`) ON DELETE CASCADE'); + if ($ret === false) { + finalResponse(UPDATE_FAILED, 'Adding constraints to machine_x_hw failed: ' . Database::lastError()); + } $ret = Database::exec('ALTER TABLE `machine_x_hw_prop` - ADD CONSTRAINT `machine_x_hw_prop_ibfk_1` FOREIGN KEY (`machinehwid`) REFERENCES `machine_x_hw` (`machinehwid`) ON DELETE CASCADE') && $ret; + ADD CONSTRAINT `machine_x_hw_prop_ibfk_1` FOREIGN KEY (`machinehwid`) REFERENCES `machine_x_hw` (`machinehwid`) ON DELETE CASCADE'); + if ($ret === false) { + finalResponse(UPDATE_FAILED, 'Adding constraint to machine_x_hw_prop failed: ' . Database::lastError()); + } $ret = Database::exec('ALTER TABLE `statistic_hw_prop` - ADD CONSTRAINT `statistic_hw_prop_ibfk_1` FOREIGN KEY (`hwid`) REFERENCES `statistic_hw` (`hwid`) ON DELETE CASCADE') && $ret; + ADD CONSTRAINT `statistic_hw_prop_ibfk_1` FOREIGN KEY (`hwid`) REFERENCES `statistic_hw` (`hwid`) ON DELETE CASCADE'); if ($ret === false) { - finalResponse(UPDATE_FAILED, 'Adding foreign key machineuuid to hardware* failed: ' . Database::lastError()); + finalResponse(UPDATE_FAILED, 'Adding constraint to statistic_hw_prop failed: ' . Database::lastError()); } } |