parent_id constraint on civicrm_activity can lead to data loss
It has probably always been like this but it seems dangerous.
- Create an activity.
- Let's give it subject "a1" so we can tell it apart.
- Fill out the schedule followup section at the bottom. Give it subject "a2".
- Save.
- Delete activity "a1".
Expected result: Just a1 is deleted.
Actual result: a1 and a2 are both deleted.
The constraint should be ON DELETE SET NULL.
As with the fix for original_id, in a large db an upgrade script might timeout or take a long time, so would need to direct the user to do it manually.