kids-first / kf-api-dataservice

:file_cabinet: Primary API for interacting with the Kids First data
http://kf-api-dataservice.kidsfirstdrc.org
Apache License 2.0
5 stars 2 forks source link

🔥 Don't delete biospecimen on sample delete #648

Closed znatty22 closed 6 months ago

znatty22 commented 6 months ago

Motivation

Right now when you delete a sample it will cascade delete all the biospecimens under it. This seems dangerous because it is not extremely clear to everyone using Dataservice that Sample = Parent Biospecimen. Everyone knows that Participant is the parent of Biospecimen and so we know not to delete Participant since it will cascade delete everything.

Approach

Remove the cascade delete configuration on Sample. When you delete a Sample, any child Biospecimen's will still exist and their sample_id field will be set to null.

This is the way Family works. You can delete Family without deleting everything under it