summaryrefslogtreecommitdiff
path: root/priv
diff options
context:
space:
mode:
authorAlexander Strizhakov <alex.strizhakov@gmail.com>2020-09-07 11:54:10 +0300
committerAlexander Strizhakov <alex.strizhakov@gmail.com>2020-09-10 16:01:20 +0300
commitc6647c08e10a45aedcd77258a0e71c41d213eaa6 (patch)
tree1ded8cf325045e2a8c7ef4b4e6b854af6af27024 /priv
parent7dd986a563545cb63e8404d9b107f1d29c499940 (diff)
migration and changelog
Diffstat (limited to 'priv')
-rw-r--r--priv/repo/migrations/20200907084956_remove_cron_clear_oauth_token_worker_from_oban_config.exs20
1 files changed, 20 insertions, 0 deletions
diff --git a/priv/repo/migrations/20200907084956_remove_cron_clear_oauth_token_worker_from_oban_config.exs b/priv/repo/migrations/20200907084956_remove_cron_clear_oauth_token_worker_from_oban_config.exs
new file mode 100644
index 000000000..d9c972563
--- /dev/null
+++ b/priv/repo/migrations/20200907084956_remove_cron_clear_oauth_token_worker_from_oban_config.exs
@@ -0,0 +1,20 @@
+defmodule Pleroma.Repo.Migrations.RemoveCronClearOauthTokenWorkerFromObanConfig do
+ use Ecto.Migration
+
+ def change do
+ with %Pleroma.ConfigDB{} = config <-
+ Pleroma.ConfigDB.get_by_params(%{group: :pleroma, key: Oban}),
+ crontab when is_list(crontab) <- config.value[:crontab],
+ index when is_integer(index) <-
+ Enum.find_index(crontab, fn {_, worker} ->
+ worker == Pleroma.Workers.Cron.ClearOauthTokenWorker
+ end) do
+ updated_value = Keyword.put(config.value, :crontab, List.delete_at(crontab, index))
+
+ config
+ |> Ecto.Changeset.change(value: updated_value)
+ |> Pleroma.Repo.update()
+ end
+
+ end
+end