Mnesia execution not stable inside mix task

Yes. Mnesia needs a schema for it to run. If it can’t find a schema then it will create a volatile one and no data will be saved on disk. You should only create the schema once. The problem here is that if you want to keep data between runs then you must create the schema once first, then every time you start erlang/elixir just do :mnesia.start(). All the data saved on disk will be kept in files in the schema directory.

4 Likes