logo

pleroma

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

20221111164213_deprecate_quack.exs (688B)


  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.DeprecateQuack do
  5. use Ecto.Migration
  6. alias Pleroma.ConfigDB
  7. def up do
  8. :quack
  9. |> ConfigDB.get_all_by_group()
  10. |> Enum.each(&ConfigDB.delete/1)
  11. logger_config = ConfigDB.get_by_group_and_key(:logger, :backends)
  12. if not is_nil(logger_config) do
  13. %{value: backends} = logger_config
  14. new_backends = backends -- [Quack.Logger]
  15. {:ok, _} = ConfigDB.update_or_create(%{group: :logger, key: :backends, value: new_backends})
  16. end
  17. end
  18. def down, do: :ok
  19. end