If you delete a parent record that has children fields with foreign keys pointing to it, I see some problems. (When I say delete, I mean a logical delete where the record is not removed, but is moved to a mirroring table of deleted records.) These problems seem common enough that many people must have them, so I imagine you might have some best practices on this issue.
What confuses me is there are cases when the children must remain in spite of the parent being gone, and other cases where the parent's deletion cascades to the child. (Child is just any record with a foreign key to another record, for the context of this discussion.)
In the case where the children must be delete-cascaded with their parent, how would you do this? Cascading deletes is a standard concept, but what about cascading "logical deletes"...how would this work? Would it just be a really ugly recursive query? (Recursive because children have other children which have other children.)
In the case where the children must remain in spite of their parent being deleted, how would that work? You may be thinking, "Why would you have a child that remains when the parent is gone? You're doing something wrong." Here's an example: A Member can create many Product Types. (i.e. Product Type has a foreign key to Member.) The Member is logically deleted (moved to a mirroring table), but you don't want to remove all Product Types that were defined by that Member! You also don't want to lose the information of which Member defined a given Product Type, even if that Member has now been deleted. How could this be accomplished?!
Your insights on this issue are highly valued. Thanks.