Skip to content
Snippets Groups Projects
Commit fec41ab1 authored by Konrad Mohrfeldt's avatar Konrad Mohrfeldt :koala:
Browse files

fix: handle episode deletions in timeslot repetition_of_id field

The update logic of the repetition_of field did not consider cases in
which the episode field of TimeSlot objects is deleted.

This fix populates the TimeSlot’s repetition_of_id field with a subquery
instead of using a separate database field for it.

The decision to keep repetition_of as a separate database field was made
on the assumption that this would be a performance problem. However, the
subquery for the repetition_of field is quite performant, especially
with a separate database index. In contrast, the update logic for a
materialized repetition_of field is quite complex and it is easy to miss
cases that should have updated the field.

As long as we don’t have an actual use case in which retrieving
timeslots becomes slow because of this subquery, we should refrain from
materializing the field.
parent 4f628891
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment