anchor.diff:  %% @end
   -spec create_schema(schema_name(), atom()) -> ok.
   create_schema(DocName, Store) ->
  +  sumo_event:dispatch(DocName, pre_schema_created),
     case sumo_store:create_schema(Store, sumo_internal:get_schema(DocName)) of
       ok ->
         sumo_event:dispatch(DocName, schema_created),
  
positive.code: -spec delete(schema_name(), user_doc()) -> boolean().
  delete(DocName, Id) ->
    IdField = sumo_internal:id_field_name(DocName),
    case delete_by(DocName, [{IdField, Id}]) of
      1 -> sumo_event:dispatch(DocName, deleted, [Id]), true;
      0 -> false
  
negative.code: -spec delete_by(schema_name(), conditions()) -> non_neg_integer().
  delete_by(DocName, Conditions) ->
    Store = sumo_config:get_store(DocName),
    sumo_event:dispatch(DocName, pre_deleted_total, [Conditions]),
    case sumo_store:delete_by(Store, DocName, Conditions) of
      {ok, 0} ->
        0;
      {ok, NumRows} ->
        sumo_event:dispatch(DocName, deleted_total, [NumRows, Conditions]),
        NumRows;
      Error ->
        throw(Error)
  