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 @@ -2,11 +2,11 @@ import Config
# Configure your database
config :gc_index_relay, GcIndexRelay.Repo,
port: 5432,
username: "postgres",
password: "postgres",
hostname: "localhost",
database: "gc_index_relay_dev",
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"),
stacktrace: true,
show_sensitive_data_on_connection_error: true,
pool_size: 10

10
config/test.exs

@ -8,11 +8,11 @@ config :gc_index_relay, :start_repo, true @@ -8,11 +8,11 @@ config :gc_index_relay, :start_repo, true
# to provide built-in test partitioning in CI environment.
# Run `mix help test` for more information.
config :gc_index_relay, GcIndexRelay.Repo,
port: 5432,
username: "postgres",
password: "postgres",
hostname: "localhost",
database: "gc_index_relay_test#{System.get_env("MIX_TEST_PARTITION")}",
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

Loading…
Cancel
Save