Add a comment about DB-CASCADE

This commit is contained in:
Klaas van Schelven
2025-03-07 15:08:37 +01:00
parent af4641a43d
commit 0ade3c0f86
2 changed files with 2 additions and 2 deletions

View File

@@ -326,7 +326,7 @@ def evict_for_epoch_and_irrelevance(project, max_epoch, max_irrelevance, max_eve
# Rather than rely on Django's implementation of CASCADE, we "just do this ourselves"; Reason is: Django does an
# extra, expensive (all-column), query on Event[...](id__in=pks_to_delete) to extract the Event ids (which we
# already have).
# already have). If Django ever gets DB-CASCADE, this may change: https://code.djangoproject.com/ticket/21961
EventTag.objects.filter(event_id__in=pks_to_delete).delete()
nr_of_deletions = Event.objects.filter(pk__in=pks_to_delete).delete()[1].get("events.Event", 0)
else: