Fix migrations: run after Repo starts, not before
This commit is contained in:
parent
93f2c32971
commit
df27209025
1 changed files with 3 additions and 8 deletions
|
|
@ -7,8 +7,6 @@ defmodule Microwaveprop.Application do
|
|||
|
||||
@impl true
|
||||
def start(_type, _args) do
|
||||
migrate()
|
||||
|
||||
children = [
|
||||
MicrowavepropWeb.Telemetry,
|
||||
Microwaveprop.Repo,
|
||||
|
|
@ -24,6 +22,9 @@ defmodule Microwaveprop.Application do
|
|||
opts = [strategy: :one_for_one, name: Microwaveprop.Supervisor]
|
||||
result = Supervisor.start_link(children, opts)
|
||||
|
||||
# Run migrations after Repo is started
|
||||
Microwaveprop.Release.migrate()
|
||||
|
||||
# Load ML model in dev/test only (Nx/Axon not compiled for prod)
|
||||
if Application.get_env(:microwaveprop, :load_ml_model, false) do
|
||||
Microwaveprop.Propagation.load_ml_model()
|
||||
|
|
@ -32,12 +33,6 @@ defmodule Microwaveprop.Application do
|
|||
result
|
||||
end
|
||||
|
||||
# Tell Phoenix to update the endpoint configuration
|
||||
# whenever the application is updated.
|
||||
defp migrate do
|
||||
Microwaveprop.Release.migrate()
|
||||
end
|
||||
|
||||
@impl true
|
||||
def config_change(changed, _new, removed) do
|
||||
MicrowavepropWeb.Endpoint.config_change(changed, removed)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue