Is there any reason why relationships aren't deleted before the object to be deleted is deleted? The benefit would be that foreign key constraints would no longer fail and, I think, it makes more sense to remove relationships before deleting, doesn't it?