init eventstore on migrate
All checks were successful
Build and Publish / build-release (push) Successful in 1m14s

This commit is contained in:
2026-04-15 17:26:13 -05:00
parent 485437da9a
commit 99c0d6131f

View File

@@ -7,6 +7,7 @@ defmodule CustomerService.Release do
def migrate do def migrate do
load_app() load_app()
init_event_store()
for repo <- repos() do for repo <- repos() do
{:ok, _, _} = Ecto.Migrator.with_repo(repo, &Ecto.Migrator.run(&1, :up, all: true)) {:ok, _, _} = Ecto.Migrator.with_repo(repo, &Ecto.Migrator.run(&1, :up, all: true))
@@ -23,8 +24,15 @@ defmodule CustomerService.Release do
end end
defp load_app do defp load_app do
# Many platforms require SSL when connecting to the database
Application.ensure_all_started(:ssl) Application.ensure_all_started(:ssl)
Application.ensure_all_started(:postgrex)
Application.ensure_loaded(@app) Application.ensure_loaded(@app)
end end
def init_event_store do
config = CustomerService.EventStore.config()
:ok = EventStore.Tasks.Create.exec(config, [])
:ok = EventStore.Tasks.Init.exec(config, [])
end
end end