Separating of Storage context

This commit is contained in:
miffy
2019-09-08 01:49:56 +02:00
parent 86a0630a7d
commit fa037fd683
34 changed files with 167 additions and 180 deletions

View File

@@ -0,0 +1,16 @@
defmodule Mobilizon.Storage.Repo do
@moduledoc """
Mobilizon Repo.
"""
use Ecto.Repo,
otp_app: :mobilizon,
adapter: Ecto.Adapters.Postgres
@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