I’m running into problem with mnesia table creation. When I’ve called :mnesia.create_table/2
with option disc_only_copies: [Node.self()]
I’ve got bad_type error. So I’ve tried :mnesia.change_table_copy_type/3
. With bigger success. Now I’m getting {:aborted, {:has_no_disc, :nonode@nohost}}
error.
I didn’t specify any host name.
Platform: Mac OS X, M2 CPU
Erlang: 26.0.2
Elixir: 1.15.5
Code snippet:
alias :mnesia, as: Mnesia
Mnesia.stop()
Mnesia.create_schema([Node.self()])
Mnesia.start()
Mnesia.create_table(Pulse,[
type: :set,
# disc_only_copies: [Node.self()],
record_name: Pulse,
attributes: @record_fields
])
Mnesia.change_table_copy_type(Pulse, Node.self(), :disc_copies)
Line commented out was used when I was creating table with disc persistence.