Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Complete cleanup of event and enrollment references across all associated tables during deletion #19383

Merged
merged 2 commits into from
Dec 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ public int deleteSoftDeletedEvents() {
"delete from trackedentitydatavalueaudit where eventid in " + eventSelect,
"delete from eventchangelog where eventid in " + eventSelect,
"delete from programmessage where eventid in " + eventSelect,
"delete from programnotificationinstance where eventid in " + eventSelect,
// finally delete the events
"delete from event where deleted is true"
};
Expand Down Expand Up @@ -205,9 +206,11 @@ public int deleteSoftDeletedEnrollments() {
"delete from trackedentitydatavalueaudit where eventid in " + eventSelect,
"delete from eventchangelog where eventid in " + eventSelect,
"delete from programmessage where eventid in " + eventSelect,
"delete from programnotificationinstance where eventid in " + eventSelect,
// delete other entries linked to enrollments
"delete from relationshipitem where enrollmentid in " + enrollmentSelect,
"delete from programmessage where enrollmentid in " + enrollmentSelect,
"delete from programnotificationinstance where enrollmentid in " + enrollmentSelect,
"delete from event where enrollmentid in " + enrollmentSelect,
// finally delete the enrollments themselves
"delete from enrollment where deleted is true"
Expand Down
Loading