meh / amnesia

Mnesia wrapper for Elixir.
693 stars 68 forks source link

Creating Mnesia directory before creating Schema #67

Closed sheharyarn closed 7 years ago

sheharyarn commented 7 years ago

:mnesia lets you configure custom directories for the database but if the directory doesn't exist, it crashes when creating schema (in the case of nested directories).

config :mnesia, dir: 'mnesia/#{Mix.env}/#{node()}'

This also causes the mix amnesia.create task to crash for custom paths. This pull fixes this by creating the configured directory for mnesia before creating the schema (if the configuration value is specified).

meh commented 7 years ago

Thanks!