For full disclosure, I’m new to Erlang. I am trying to create a mnesia table on disc not ram. This code does so successfully.:
initialize_mnesia() ->
mnesia:stop(),
application:set_env(mnesia, dir, "/tmp/star_watch_db"),
mnesia:create_schema([node()]),
mnesia:start(),
CreateResult = mnesia:create_table(
apodimagetable,
[
{attributes, record_info(fields, apodimagetable)},
{index, [#apodimagetable.date, #apodimagetable.title, #apodimagetable.hdurl]},
{type, ordered_set},
{disc_copies, nodes()}
]),
mnesia:change_table_copy_type(apodimagetable, node(), disc_copies).
If I omit the call to change_table_copy(), the ‘apodimagetable’ is NOT disc based. It is ram based. All the docs I’ve read do not mention the need for calling change_table_copy_type. What am I missing?