Loris
Loris copied to clipboard
[old datadict] data_dictionary_builder script crashing because of a SQL constraint violation
Describe the bug
While doing my testing for Loris 26, I failed to run the data_dictionary_builder.php
because of an SQL contraint violation. After discussing it with @ridz1208, it seems this behaviour is indeed unexpected.
Copy of the error :
lorisadmin@test-dev-260:/var/www/Loris/tools/exporters$ php data_dictionary_builder.php
PHP Fatal error: Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`test_dev_260`.`publication_parameter_type_rel`, CONSTRAINT `FK_publication_parameter_type_rel_ParameterTypeID` FOREIGN KEY (`ParameterTypeID`) REFERENCES `parameter_type` (`ParameterTypeID`)) in /var/www/Loris/php/libraries/Database.class.inc:645
Stack trace:
#0 /var/www/Loris/php/libraries/Database.class.inc(645): PDO->exec()
#1 /var/www/Loris/tools/exporters/data_dictionary_builder.php(65): Database->run()
#2 {main}
thrown in /var/www/Loris/php/libraries/Database.class.inc on line 645
I don't have much knowledge on these tables so someone more familiar with them should probably look into it.