diff --git a/apps/horst/src/core/horst_app.erl b/apps/horst/src/core/horst_app.erl index 16d6316..5001d5e 100644 --- a/apps/horst/src/core/horst_app.erl +++ b/apps/horst/src/core/horst_app.erl @@ -11,7 +11,15 @@ start(_StartType, _StartArgs) -> + start_database(), horst_sup:start_link(). stop(_State) -> - ok. \ No newline at end of file + ok. + +start_database() -> + lager:info("create the schema for the database"), + application:stop(mnesia), + mnesia:create_schema([node()]), + lager:info("start the database"), + application:start(mnesia). \ No newline at end of file diff --git a/rel/files/vm.args b/rel/files/vm.args index 1537e8c..117ba8f 100644 --- a/rel/files/vm.args +++ b/rel/files/vm.args @@ -1,9 +1,12 @@ ## Name of the node --name erlything@127.0.0.1 +-sname erlything ## Cookie for distributed erlang -setcookie {{cookie}} +## mnesia dir +-mnesia dir data + ## Heartbeat management; auto-restarts VM if it dies or becomes unresponsive ## (Disabled by default..use with caution!) ##-heart diff --git a/rel/reltool.config b/rel/reltool.config index 1ec8a34..e14f552 100644 --- a/rel/reltool.config +++ b/rel/reltool.config @@ -40,6 +40,7 @@ {overlay, [ {mkdir, "etc"}, {mkdir, "log/sasl"}, + {mkdir, "data"}, {template, "../etc/app.config.template", "etc/app.config"}, {copy, "files/erl", "\{\{erts_vsn\}\}/bin/erl"}, {copy, "files/nodetool", "\{\{erts_vsn\}\}/bin/nodetool"},