anchor.diff:              end
       end.
   
  -maybe_wait_for_tables() ->
  -    lager:log(info, self(), "Waiting for tables: ~p", [?TABLES]),
  -    case mnesia:wait_for_tables(?TABLES, ?WAIT_TIMEOUT) of
  -        ok -> ok;
  -        {timeout, Tables} ->
  -            lager:log(error, self(), "Timeout waiting for tables: ~p", [Tables]),
  -            error;
  -        {error, Reason} ->
  -            lager:log(error, self(), "Error waiting for tables: ~p", [Reason]),
  -            error
  -    end.
  -
   maybe_add_local_node(Nodes) ->
       case lists:member(node(), Nodes) of
           true -> Nodes;
  -        false -> lists:merge([node()], Nodes)
  +        false -> lists:merge(Nodes, [node()])
       end.
   
   maybe_remove_local_node(Nodes) ->
  
positive.code:         {aborted, Reason} ->
              lager:log(error, self(), "Error creating table: ~p", [Reason]),
              error
      end.
  
  has_tables() ->
  
negative.code: -define(WAIT_TIMEOUT, 60000).
  
  start() ->
      lager:debug("Starting privpaste_mnesia"),
      mnesia:start(),
      maybe_initialize(),
      wait_for_tables().
  
  backup() ->
      lager:info("Backing up the existing database"),
      mnesia:backup("/var/lib/privatepaste/backup.bup").
  
  restore() ->
      lager:info("Restoring the database from a backup"),
      mnesia:restore("/var/lib/privatepaste/backup.bup", []).
  
  create_schema(Nodes) ->
      lager:info("Creating schema with nodes: ~p", [Nodes]),
      case mnesia:create_schema(Nodes) of
          ok -> ok;
          {error, Reason} -> lager:error("Error creating schema: ~p", [Reason])
  