From 51efa88a15d43af692e7de00485b82c69bba234d Mon Sep 17 00:00:00 2001 From: buttercat1791 Date: Wed, 25 Feb 2026 21:30:56 -0600 Subject: [PATCH] Reduce env read duplication in config hierarchy --- config/config.exs | 4 ++-- config/dev.exs | 7 ++----- config/test.exs | 2 -- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/config/config.exs b/config/config.exs index adc7f6b..d2b5317 100644 --- a/config/config.exs +++ b/config/config.exs @@ -12,8 +12,8 @@ config :gc_index_relay, generators: [timestamp_type: :utc_datetime] config :gc_index_relay, GcIndexRelay.Repo, - username: System.get_env("POSTGRES_ADMIN_USER"), - password: System.get_env("POSTGRES_ADMIN_PASSWORD"), + username: System.get_env("POSTGRES_USER"), + password: System.get_env("POSTGRES_PASSWORD"), database: System.get_env("POSTGRES_DB"), hostname: System.get_env("POSTGRES_HOST"), stacktrace: true, diff --git a/config/dev.exs b/config/dev.exs index 7b2e2db..cdd2b95 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -2,11 +2,8 @@ import Config # Configure your database config :gc_index_relay, GcIndexRelay.Repo, - username: System.get_env("POSTGRES_USER"), - password: System.get_env("POSTGRES_PASSWORD"), - database: System.get_env("POSTGRES_DB"), - hostname: System.get_env("POSTGRES_HOST"), - port: System.get_env("POSTGRES_PORT"), + username: System.get_env("POSTGRES_ADMIN_USER"), + password: System.get_env("POSTGRES_ADMIN_PASSWORD"), stacktrace: true, show_sensitive_data_on_connection_error: true, pool_size: 10 diff --git a/config/test.exs b/config/test.exs index 9a1f564..6e8d5ce 100644 --- a/config/test.exs +++ b/config/test.exs @@ -10,8 +10,6 @@ config :gc_index_relay, :start_repo, true config :gc_index_relay, GcIndexRelay.Repo, username: System.get_env("POSTGRES_USER"), password: System.get_env("POSTGRES_PASSWORD"), - hostname: System.get_env("POSTGRES_HOST"), - port: System.get_env("POSTGRES_PORT"), database: "#{System.get_env("POSTGRES_DB")}#{System.get_env("MIX_TEST_PARTITION")}", pool: Ecto.Adapters.SQL.Sandbox, pool_size: System.schedulers_online() * 2