diff options
Diffstat (limited to 'lib/pleroma/repo.ex')
-rw-r--r-- | lib/pleroma/repo.ex | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/pleroma/repo.ex b/lib/pleroma/repo.ex new file mode 100644 index 000000000..7cecd7b38 --- /dev/null +++ b/lib/pleroma/repo.ex @@ -0,0 +1,11 @@ +defmodule Pleroma.Repo do + use Ecto.Repo, otp_app: :pleroma + + @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 |