2018-10-11 17:37:39 +02:00
|
|
|
defmodule Mobilizon.Repo do
|
2018-01-14 17:56:50 +01:00
|
|
|
@moduledoc """
|
2018-10-11 17:37:39 +02:00
|
|
|
Mobilizon Repo
|
2018-01-14 17:56:50 +01:00
|
|
|
"""
|
2018-10-11 17:37:39 +02:00
|
|
|
use Ecto.Repo, otp_app: :mobilizon
|
2017-12-08 09:58:14 +01:00
|
|
|
|
|
|
|
@doc """
|
|
|
|
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
|