johnhamelink
2/11/2016 - 6:41 PM

discovery_handler.ex

    table_infos = for t <- :mnesia.system_info(:tables) do
      {t, :mnesia.table_info(t, :where_to_commit)}
    end

    for {tb, [{node_to_connect, type}]} <- table_infos do
      {tb, :mnesia.add_table_copy(tb, node(), type)}
    end