anchor.diff:  
   %% @doc Delete only selected checksums from a given cookbook version,
   %% as opposed to all checksums associated with a given cookbook
  -%% version (for that, see `delete_cookbook_version_checksums/2').
  -delete_cookbook_checksums([], _OrgId, _CookbookVersionId) ->
  +%% version (for that, see `unlink_all_checksums_from_cbv/2').
  +unlink_checksums_from_cbv([], _OrgId, _CookbookVersionId) ->
       ok;
  -delete_cookbook_checksums([Checksum|Rest], OrgId, CookbookVersionId) ->
  +unlink_checksums_from_cbv([Checksum|Rest], OrgId, CookbookVersionId) ->
       case sqerl:statement(delete_cookbook_version_checksum, [Checksum, OrgId, CookbookVersionId], count) of
           {ok, _Count} ->
  -            delete_cookbook_checksums(Rest, OrgId, CookbookVersionId);
  +            unlink_checksums_from_cbv(Rest, OrgId, CookbookVersionId);
           Error ->
               Error
       end.
  
positive.code:             {error, Reason}
      end.
  
  %% @doc Delete all checksums for a given cookbook version
  -spec delete_cookbook_version_checksums(OrgId::object_id(),
                                         CookbookVersionId::object_id()) ->
                                          {ok, [binary()]} | {error, term()}.
  delete_cookbook_version_checksums(OrgId, CookbookVersionId) ->
      % retrieve a list of checksums before we delete the
      % cookbook_version_checksums record
      Checksums = fetch_cookbook_version_checksums(OrgId, CookbookVersionId),
      case sqerl:statement(delete_cookbook_checksums_by_orgid_cookbook_versionid,
                              [OrgId, CookbookVersionId]) of
          {ok, _} ->
              {ok, delete_checksums(OrgId, Checksums)};
          {error, Error} ->
              {error, Error}
      end.
  %% @doc Deletes a list of checksums from the checksums table.  Happily swallows
  %% foreign_key constraint errors assuming the checksum is still associated with
  %% another cookbook_version_checksum record.  Returns a list of deleted checksum
  %% ids for further upstream processing(ie delete the checksums from S3).
  -spec delete_checksums(OrgId::binary(),
                         Checksums::[binary()]) -> [binary()].
  delete_checksums(OrgId, Checksums) ->
      lists:foldl(fun(Checksum, Acc) ->
              case sqerl:statement(delete_checksum_by_id, [OrgId, Checksum]) of
                  {ok, N} when is_integer(N) -> %% pretend there is 1
  
negative.code:     %% that aren't in the new version's list are targeted for deletion
      UnlinkFromCBV = sets:to_list(sets:subtract(OldChecksums,
                                                 NewChecksums)),
  
      %% Conversely, checksums that are in the new list but not the old
      %% need to be added to the system
      AddToCBV = sets:to_list(sets:subtract(NewChecksums,
                                            OldChecksums)),
  
      %% We must first dissociate the checksums-to-be-deleted from the
  