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 (591B)


  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,
  10. where: c.group == ^:pleroma and c.key == ^Pleroma.Plugs.RemoteIp
  11. )
  12. |> Pleroma.Repo.one()
  13. if config do
  14. config
  15. |> Ecto.Changeset.change(key: Pleroma.Web.Plugs.RemoteIp)
  16. |> Pleroma.Repo.update()
  17. end
  18. end
  19. def down, do: :ok
  20. end