logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git

20200919182636_remoteip_plug_rename.exs (576B)


  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Pleroma.Repo.Migrations.RemoteipPlugRename do
  5. use Ecto.Migration
  6. import Ecto.Query
  7. def up do
  8. config =
  9. from(c in Pleroma.ConfigDB, where: c.group == ^:pleroma and c.key == ^Pleroma.Plugs.RemoteIp)
  10. |> Pleroma.Repo.one()
  11. if config do
  12. config
  13. |> Ecto.Changeset.change(key: Pleroma.Web.Plugs.RemoteIp)
  14. |> Pleroma.Repo.update()
  15. end
  16. end
  17. def down, do: :ok
  18. end