This commit is contained in:
2024-06-02 13:31:19 +02:00
parent 9d547bcdf2
commit 443081e086
67 changed files with 623 additions and 4282 deletions

View File

@ -1,28 +0,0 @@
defmodule SomethingErlang.Release do
@moduledoc """
Used for executing DB release tasks when run in production without Mix
installed.
"""
@app :something_erlang
def migrate do
load_app()
for repo <- repos() do
{:ok, _, _} = Ecto.Migrator.with_repo(repo, &Ecto.Migrator.run(&1, :up, all: true))
end
end
def rollback(repo, version) do
load_app()
{:ok, _, _} = Ecto.Migrator.with_repo(repo, &Ecto.Migrator.run(&1, :down, to: version))
end
defp repos do
Application.fetch_env!(@app, :ecto_repos)
end
defp load_app do
Application.load(@app)
end
end