224d784e3420969027f1142ec8b4502c7c5f7717
[akkoma] / lib / pleroma / repo.ex
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Repo do
6 use Ecto.Repo, otp_app: :pleroma, adapter: Ecto.Adapters.Postgres
7
8 @doc """
9 Dynamically loads the repository url from the
10 DATABASE_URL environment variable.
11 """
12 def init(_, opts) do
13 {:ok, Keyword.put(opts, :url, System.get_env("DATABASE_URL"))}
14 end
15 end