Skip to content

Commit 23caf60

Browse files
committed
Delete notifications when reseting organisation
Without this we get foreign key constraint errors when the organisation is reset.
1 parent 0b0c3b1 commit 23caf60

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

app/controllers/dev_controller.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ def reset_organisation
4747
organisation_sessions = Session.where(organisation:)
4848

4949
ClassImport.where(session: organisation_sessions).destroy_all
50+
ConsentNotification.where(session: organisation_sessions).destroy_all
51+
SessionNotification.where(session: organisation_sessions).destroy_all
5052

5153
patient_sessions = PatientSession.where(session: organisation_sessions)
5254
patient_sessions.each do |patient_session|

0 commit comments

Comments
 (0)