0
votes

Is it possible to use Amnesia with distillery. Because mix is unavailable in a distillery release, I am unsure how I would go about creating the mnesia db.

1

1 Answers

1
votes

The distillery docs provide some guidance on running tasks like migrations.

The Amnesia mix task seems to simply call into your database modules create! function:

  def run(args) do
    options = parse_args(args)
    copying = parse_copying(options)
    db = ensure_database_module(options[:database])

    if options[:schema] do
      Amnesia.Schema.create
    end

    Amnesia.start
    try do
      db.create!(copying)
      :ok = db.wait(15000)
    after
      Amnesia.stop
    end
  end

So you should be able to replicate this in your own module, and invoke it with a distillery custom command