spc-pleroma/lib/pleroma/repo.ex

23 lines
591 B
Elixir
Raw Normal View History

# Pleroma: A lightweight social networking server
2018-12-31 15:41:47 +00:00
# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
2017-03-17 16:09:58 +00:00
defmodule Pleroma.Repo do
2019-03-20 13:04:59 +00:00
use Ecto.Repo,
otp_app: :pleroma,
adapter: Ecto.Adapters.Postgres,
migration_timestamps: [type: :naive_datetime_usec]
2017-03-17 16:09:58 +00:00
2019-01-30 15:32:30 +00:00
defmodule Instrumenter do
use Prometheus.EctoInstrumenter
end
2017-03-17 16:09:58 +00: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