Browse Source

Read DB connection details from env

master
buttercat1791 2 months ago
parent
commit
a0e0b2fd0d
  1. 10
      config/dev.exs
  2. 10
      config/test.exs

10
config/dev.exs

@ -2,11 +2,11 @@ import Config
# Configure your database # Configure your database
config :gc_index_relay, GcIndexRelay.Repo, config :gc_index_relay, GcIndexRelay.Repo,
port: 5432, username: System.get_env("POSTGRES_USER"),
username: "postgres", password: System.get_env("POSTGRES_PASSWORD"),
password: "postgres", database: System.get_env("POSTGRES_DB"),
hostname: "localhost", hostname: System.get_env("POSTGRES_HOST"),
database: "gc_index_relay_dev", port: System.get_env("POSTGRES_PORT"),
stacktrace: true, stacktrace: true,
show_sensitive_data_on_connection_error: true, show_sensitive_data_on_connection_error: true,
pool_size: 10 pool_size: 10

10
config/test.exs

@ -8,11 +8,11 @@ config :gc_index_relay, :start_repo, true
# to provide built-in test partitioning in CI environment. # to provide built-in test partitioning in CI environment.
# Run `mix help test` for more information. # Run `mix help test` for more information.
config :gc_index_relay, GcIndexRelay.Repo, config :gc_index_relay, GcIndexRelay.Repo,
port: 5432, username: System.get_env("POSTGRES_USER"),
username: "postgres", password: System.get_env("POSTGRES_PASSWORD"),
password: "postgres", hostname: System.get_env("POSTGRES_HOST"),
hostname: "localhost", port: System.get_env("POSTGRES_PORT"),
database: "gc_index_relay_test#{System.get_env("MIX_TEST_PARTITION")}", database: "#{System.get_env("POSTGRES_DB")}#{System.get_env("MIX_TEST_PARTITION")}",
pool: Ecto.Adapters.SQL.Sandbox, pool: Ecto.Adapters.SQL.Sandbox,
pool_size: System.schedulers_online() * 2 pool_size: System.schedulers_online() * 2

Loading…
Cancel
Save