migration and warning for RemoteIp plug rename
This commit is contained in:
parent
5f2071c458
commit
3cb9c88837
2 changed files with 37 additions and 1 deletions
19
priv/repo/migrations/20200919182636_remoteip_plug_rename.exs
Normal file
19
priv/repo/migrations/20200919182636_remoteip_plug_rename.exs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
defmodule Pleroma.Repo.Migrations.RemoteipPlugRename do
|
||||
use Ecto.Migration
|
||||
|
||||
import Ecto.Query
|
||||
|
||||
def up do
|
||||
config =
|
||||
from(c in Pleroma.ConfigDB, where: c.group == ^:pleroma and c.key == ^Pleroma.Plugs.RemoteIp)
|
||||
|> Pleroma.Repo.one()
|
||||
|
||||
if config do
|
||||
config
|
||||
|> Ecto.Changeset.change(key: Pleroma.Web.Plugs.RemoteIp)
|
||||
|> Pleroma.Repo.update()
|
||||
end
|
||||
end
|
||||
|
||||
def down, do: :ok
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue