debianize-mobilizon/lib/mobilizon/storage/repo.ex

17 lines
357 B
Elixir
Raw Normal View History

2019-09-08 01:49:56 +02:00
defmodule Mobilizon.Storage.Repo do
@moduledoc """
2019-09-08 01:49:56 +02:00
Mobilizon Repo.
"""
2019-09-08 01:49:56 +02:00
use Ecto.Repo,
otp_app: :mobilizon,
adapter: Ecto.Adapters.Postgres
@doc """
2019-09-08 01:49:56 +02:00
Dynamically loads the repository url from the DATABASE_URL environment variable.
"""
def init(_, opts) do
{:ok, Keyword.put(opts, :url, System.get_env("DATABASE_URL"))}
end
end