From b677f65454a1f2197b9d5cf302b470cd9fbe1559 Mon Sep 17 00:00:00 2001 From: Jeroen Date: Fri, 18 Aug 2023 13:42:39 +0200 Subject: [PATCH] Start app in migration to avoid SSL errors --- core/lib/core/release.ex | 6 ++++++ core/mix.exs | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/core/lib/core/release.ex b/core/lib/core/release.ex index 5e3521fe0e..92b85540fc 100644 --- a/core/lib/core/release.ex +++ b/core/lib/core/release.ex @@ -2,16 +2,22 @@ defmodule Core.Release do @app :core 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 diff --git a/core/mix.exs b/core/mix.exs index 92c1daa940..1c7c1f1933 100644 --- a/core/mix.exs +++ b/core/mix.exs @@ -44,7 +44,7 @@ defmodule Core.MixProject do def application do [ mod: {Core.Application, []}, - extra_applications: [:logger, :runtime_tools, :csv] + extra_applications: [:logger, :runtime_tools, :csv, :ssl] ] end