DOMjudge / domjudge

DOMjudge programming contest jury system
https://www.domjudge.org
GNU General Public License v2.0
703 stars 249 forks source link

Cannot delete team due to foreign key constraint #2464

Open eldering opened 2 months ago

eldering commented 2 months ago

Description of the problem

When you try to delete a team, then it doesn't work. From the UI it just does not respond, but from a MySQL command line, the following error shows:

Error in query (1451): Cannot delete or update a parent row: a foreign key constraint fails (`domjudge`.`judging_run`, CONSTRAINT `FK_29A6E6E13CBA64F2` FOREIGN KEY (`judgetaskid`) REFERENCES `judgetask` (`judgetaskid`)) 

Changing the constraint to ON DELETE CASCADE does make it work. If changing this, we should check if there are any diamond diagram dependencies involved here and if we need to encode that.

Your environment

DOMjudge on wfluxor-online branch, most likely also on main.