Document soft delete cleared generated-document references but left control, risk, and measure junction rows pointing at deleted documents. That blocked risk deletion and made unlinkRisk fail when the document was already gone. Remove entity mappings in SoftDelete and BulkSoftDelete, drop mappings before deleting a risk, tolerate missing documents when unlinking, and backfill orphaned junction rows for soft-deleted documents. Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Bryan FRIMIN <bryan@frimin.fr>
29 KiB
29 KiB