or application. Then each of the sub-objects like comments, notes etc were deleted. This order is bad because it makes the database inconsistent, we never want a comment/note/etc for a version that doesn't exist. Delete the sub objects first and then the parent object.