migration to remove old cron jobs

This commit is contained in:
Alexander Strizhakov 2020-09-11 09:09:28 +03:00
parent 6316350918
commit e3ca0a7e2d
No known key found for this signature in database
GPG key ID: 022896A53AEF1381

View file

@ -0,0 +1,20 @@
defmodule Pleroma.Repo.Migrations.RemoveCronJobs do
use Ecto.Migration
import Ecto.Query, only: [from: 2]
def up do
from(j in "oban_jobs",
where:
j.worker in ^[
"Pleroma.Workers.Cron.PurgeExpiredActivitiesWorker",
"Pleroma.Workers.Cron.StatsWorker",
"Pleroma.Workers.Cron.ClearOauthTokenWorker"
],
select: [:id]
)
|> Pleroma.Repo.delete_all()
end
def down, do: :ok
end