Including :mnesia in release, without starting it

Yeah, I wish documentation and error messages were better in Mnesia.

If Mnesia has already started with :extra_applications, you should run this instead of :create_schema/1:

:mnesia.change_table_copy_type(:schema, node(), :disc_copies)

Otherwise if you only load :mnesia with :included_applications, then you should run this:

:mnesia.create_schema([node()])
:mnesia.start()

After that, :mnesia.create_table/2 should work. Remember to also run :mnesia.wait_for_tables/2 to ensure that the node/cluster is ready.

And as I mentioned in the other thread, I believe the error with Mnesia missing from the release is because of a bug in Elixir 1.9.0. 1.9.1 should resolve that.

6 Likes