sjucker / zkmf2024-server

ZKMF2024 Server
1 stars 1 forks source link

Deleting of timetable entry causes problem when judges are already assigned #48

Open sjucker opened 4 months ago

sjucker commented 4 months ago
13:14:28.612 [http-nio-27765-exec-2] INFO  c.z.s.rest.secured.AdminEndpoint - DELETE /secured/admin/timetable/entry/93
13:14:28.839 [http-nio-27765-exec-2] ERROR o.a.c.c.C.[.[.[.[dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: org.springframework.dao.DataIntegrityViolationException: jOOQ; SQL [delete from "timetable_entry" where "timetable_entry"."id" = ?]; ERROR: update or delete on table "timetable_entry" violates foreign key constraint "fk_judge_report_timetable" on table "judge_report"
  Detail: Key (id)=(93) is still referenced from table "judge_report".] with root cause
org.postgresql.util.PSQLException: ERROR: update or delete on table "timetable_entry" violates foreign key constraint "fk_judge_report_timetable" on table "judge_report"
  Detail: Key (id)=(93) is still referenced from table "judge_report".
mpkeusch commented 1 month ago

Should we in this case disallow the 'delete' operation (hide in admin gui) or what is the correct operation to do?

sjucker commented 1 month ago

Hoi Florian 👋

Easiest would be to just disable delete-button in admin-UI if there are judges assigned.