From 422df5f60f32ac3d8ded7dbc08fbe48101b074a6 Mon Sep 17 00:00:00 2001 From: Eliot Jordan Date: Wed, 25 Sep 2024 11:38:39 -0500 Subject: [PATCH 1/2] Remove Figgy from Ecto repos --- config/config.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/config.exs b/config/config.exs index c7a22718..b5b702a9 100644 --- a/config/config.exs +++ b/config/config.exs @@ -8,7 +8,7 @@ import Config config :dpul_collections, - ecto_repos: [DpulCollections.Repo, DpulCollections.FiggyRepo], + ecto_repos: [DpulCollections.Repo], generators: [timestamp_type: :utc_datetime] # Configures the endpoint From 9d243dc60713a88e5f93581e4c9ac1f7b5f702a9 Mon Sep 17 00:00:00 2001 From: Eliot Jordan Date: Wed, 25 Sep 2024 11:55:15 -0500 Subject: [PATCH 2/2] Mix is not available in prod. Set current_env instead --- config/dev.exs | 3 +++ config/prod.exs | 3 +++ config/test.exs | 3 +++ lib/dpul_collections/application.ex | 2 +- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/config/dev.exs b/config/dev.exs index aaf152b3..e7b07537 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -74,6 +74,9 @@ config :dpul_collections, DpulCollectionsWeb.Endpoint, ] ] +# Set environment +config :dpul_collections, :current_env, :dev + # Enable dev routes for dashboard and mailbox config :dpul_collections, dev_routes: true diff --git a/config/prod.exs b/config/prod.exs index 399fb97e..c18f97b0 100644 --- a/config/prod.exs +++ b/config/prod.exs @@ -8,6 +8,9 @@ import Config config :dpul_collections, DpulCollectionsWeb.Endpoint, cache_static_manifest: "priv/static/cache_manifest.json" +# Set environment +config :dpul_collections, :current_env, :prod + # Configures Swoosh API Client config :swoosh, api_client: Swoosh.ApiClient.Finch, finch_name: DpulCollections.Finch diff --git a/config/test.exs b/config/test.exs index e81df83f..446da69b 100644 --- a/config/test.exs +++ b/config/test.exs @@ -36,6 +36,9 @@ config :dpul_collections, DpulCollectionsWeb.Endpoint, # In test we don't send emails. config :dpul_collections, DpulCollections.Mailer, adapter: Swoosh.Adapters.Test +# Set environment +config :dpul_collections, :current_env, :test + # Disable swoosh api client as it is only required for production adapters. config :swoosh, :api_client, false diff --git a/lib/dpul_collections/application.ex b/lib/dpul_collections/application.ex index 49325dd6..ee123115 100644 --- a/lib/dpul_collections/application.ex +++ b/lib/dpul_collections/application.ex @@ -21,7 +21,7 @@ defmodule DpulCollections.Application do # {DpulCollections.Worker, arg}, # Start to serve requests, typically the last entry DpulCollectionsWeb.Endpoint - ] ++ environment_children(Mix.env()) + ] ++ environment_children(Application.fetch_env!(:dpul_collections, :current_env)) # See https://hexdocs.pm/elixir/Supervisor.html # for other strategies and supported options