Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
691B

  1. defmodule Elixir.Pleroma.Repo.Migrations.Oban20ConfigChanges do
  2. use Ecto.Migration
  3. import Ecto.Query
  4. alias Pleroma.ConfigDB
  5. alias Pleroma.Repo
  6. def change do
  7. config_entry =
  8. from(c in ConfigDB, where: c.group == ^":pleroma" and c.key == ^"Oban")
  9. |> select([c], struct(c, [:value, :id]))
  10. |> Repo.one()
  11. if config_entry do
  12. %{value: value} = config_entry
  13. value =
  14. case Keyword.fetch(value, :verbose) do
  15. {:ok, log} -> Keyword.put_new(value, :log, log)
  16. _ -> value
  17. end
  18. |> Keyword.drop([:verbose, :prune])
  19. Ecto.Changeset.change(config_entry, %{value: value})
  20. |> Repo.update()
  21. end
  22. end
  23. end