fix: run migrator on startup
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
defmodule Localiser.Migrator do
|
||||
use GenServer
|
||||
|
||||
def start_link(args) do
|
||||
GenServer.start_link(__MODULE__, args, name: __MODULE__)
|
||||
end
|
||||
|
||||
def init(_args) do
|
||||
path = Application.app_dir(:localiserd, "priv/repo/migrations")
|
||||
Ecto.Migrator.run(Localiser.Repo, path, :up, all: true)
|
||||
{:ok, %{}}
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user