repo.ex 456 Bytes
Newer Older
1
# Pleroma: A lightweight social networking server
kaniini's avatar
kaniini committed
2
# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
3 4
# SPDX-License-Identifier: AGPL-3.0-only

lain's avatar
lain committed
5
defmodule Pleroma.Repo do
rinpatch's avatar
rinpatch committed
6
  use Ecto.Repo, otp_app: :pleroma, adapter: Ecto.Adapters.Postgres
lain's avatar
lain committed
7 8 9 10 11 12 13 14 15

  @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