anchor.diff:  
   -export([
            assemble_cookbook_ejson/2,
  +         authz_id/1,
            base_cookbook_name/1,
            constraint_map_spec/1,
  +         ejson_for_indexing/2,
            extract_checksums/1,
            id/1,
            minimal_cookbook_ejson/2,
  
positive.code:          parse_binary_json/2,
           parse_version/1,
           qualified_recipe_names/2,
           type_name/1,
           version_to_binary/1
          ]).
  
  -ifdef(TEST).
  
negative.code:         _ ->
              <<CookbookName/binary, "::", StrippedName/binary>>
      end.
  
  create_query() ->
      insert_cookbook_version.
  
  update_query() ->
      update_cookbook_version.
  
  delete_query() ->
      delete_cookbook_version_by_id.
  
  find_query() ->
      find_cookbook_version_by_orgid_name_version.
  
  list_query() ->
      list_cookbook_versions_by_orgid.
  
  bulk_get_query() ->
      error(not_implemented).
  
  update_from_ejson(#chef_cookbook_version{org_id = OrgId,
                                           authz_id = AuthzId,
                                           frozen = FrozenOrig} = CookbookVersion,
                    CookbookVersionData) ->
      UpdatedVersion = new_record(OrgId, AuthzId, CookbookVersionData),
      %% frozen is immutable once it is set to true
      Frozen = FrozenOrig =:= true orelse UpdatedVersion#chef_cookbook_version.frozen,
      CookbookVersion#chef_cookbook_version{frozen            = Frozen,
                                            meta_attributes   = UpdatedVersion#chef_cookbook_version.meta_attributes,
                                            meta_deps         = UpdatedVersion#chef_cookbook_version.meta_deps,
                                            meta_long_desc    = UpdatedVersion#chef_cookbook_version.meta_long_desc,
                                            metadata          = UpdatedVersion#chef_cookbook_version.metadata,
                                            checksums         = UpdatedVersion#chef_cookbook_version.checksums,
                                            serialized_object = UpdatedVersion#chef_cookbook_version.serialized_object}.
  
  ejson_for_indexing(#chef_cookbook_version{}, _CBV) ->
      error(not_indexed).
  