rcpch / rcpch-audit-engine

Epilepsy12 Audit Platform
https://e12.rcpch.ac.uk/
GNU Affero General Public License v3.0
5 stars 4 forks source link

Orphan KPI and AuditProgress records #971

Closed eatyourpeas closed 1 month ago

eatyourpeas commented 2 months ago

When a Case is deleted, the registration and associated records are deleted, but not the KPI and AuditProgress records also.

To fix this issue will require two steps:

  1. refactor the delete function in case_views.py
  2. In the django shell in live/staging/development, remove all orphan KPI and AuditProgress records which have no registration instance
eatyourpeas commented 2 months ago

when #972 merges that will fix this issue, but leaving open here as still need to prune the databases of orphan records

eatyourpeas commented 2 months ago

Now merged. There are 278 orphan/empty KPI/AuditProgress records in live to remove

eatyourpeas commented 1 month ago

These have now been removed. More are likely to appear until these changes in development are merged in to live, but hopefully we can tidy again at that point.