Skip to content

Commit

Permalink
fix(cleanup) Remove NotificationMessage before RuleFireHistory (#76599)
Browse files Browse the repository at this point in the history
NotificationMessage has a foreign key constraint pointing to
RuleFireHistory. Currently cleanup is failing because we have the
deletion order incorrect.

Fixes SENTRY-3BW5
  • Loading branch information
markstory committed Aug 27, 2024
1 parent 3a643a6 commit 711f90d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sentry/runner/commands/cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ def is_filtered(model: type[Model]) -> bool:
BULK_QUERY_DELETES = [
(models.UserReport, "date_added", None),
(models.GroupEmailThread, "date", None),
(RuleFireHistory, "date_added", None),
(NotificationMessage, "date_added", None),
(RuleFireHistory, "date_added", None),
] + additional_bulk_query_deletes

# Deletions that use the `deletions` code path (which handles their child relations)
Expand Down

0 comments on commit 711f90d

Please sign in to comment.