2024-03-11 21:55:17 +03:00
|
|
|
defmodule Algora.Repo.Local do
|
2024-02-29 22:31:42 +03:00
|
|
|
use Ecto.Repo,
|
|
|
|
otp_app: :algora,
|
|
|
|
adapter: Ecto.Adapters.Postgres
|
|
|
|
|
2024-03-11 21:55:17 +03:00
|
|
|
@env Mix.env()
|
2024-02-29 22:31:42 +03:00
|
|
|
|
2024-03-11 21:55:17 +03:00
|
|
|
# Dynamically configure the database url based on runtime and build
|
|
|
|
# environments.
|
|
|
|
def init(_type, config) do
|
|
|
|
# url = Fly.Postgres.rewrite_database_url!(config)
|
|
|
|
# dbg(url)
|
2024-02-29 22:31:42 +03:00
|
|
|
|
2024-03-11 21:55:17 +03:00
|
|
|
Fly.Postgres.config_repo_url(config, @env)
|
2024-02-29 22:31:42 +03:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2024-03-11 21:55:17 +03:00
|
|
|
defmodule Algora.Repo do
|
|
|
|
use Fly.Repo, local_repo: Algora.Repo.Local
|
2024-02-29 22:31:42 +03:00
|
|
|
end
|