Skip to content

Commit 3b254a1

Browse files
Copilotmaxneuvians
andauthored
[WIP] [Bug]: App files to compile if DATABASE_URL is not set (#62)
* Initial plan * Fix: provide fallback DATABASE_URL for dev and test environments Co-authored-by: maxneuvians <867334+maxneuvians@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: maxneuvians <867334+maxneuvians@users.noreply.github.com>
1 parent 065452d commit 3b254a1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

valentine/config/dev.exs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import Config
22

33
# Configure your database
44
config :valentine, Valentine.Repo,
5-
url: System.get_env("DATABASE_URL") <> "/valentine_dev",
5+
url:
6+
(System.get_env("DATABASE_URL") || "ecto://postgres:postgres@localhost") <> "/valentine_dev",
67
stacktrace: true,
78
show_sensitive_data_on_connection_error: true,
89
pool_size: 10

valentine/config/test.exs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ import Config
66
# to provide built-in test partitioning in CI environment.
77
# Run `mix help test` for more information.
88
config :valentine, Valentine.Repo,
9-
url: System.get_env("DATABASE_URL") <> "/valentine_test#{System.get_env("MIX_TEST_PARTITION")}",
9+
url:
10+
(System.get_env("DATABASE_URL") || "ecto://postgres:postgres@localhost") <>
11+
"/valentine_test#{System.get_env("MIX_TEST_PARTITION")}",
1012
pool: Ecto.Adapters.SQL.Sandbox,
1113
pool_size: System.schedulers_online() * 2
1214

0 commit comments

Comments
 (0)