Skip to content

Cannot delete team due to foreign key constraint #2464

@eldering

Description

@eldering

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions