Merge pull request 'Add dark and light theme mode to docs, detection, and button...
[akkoma] / priv / repo / migrations / 20200915095704_remove_background_jobs.exs
1 defmodule Pleroma.Repo.Migrations.RemoveBackgroundJobs do
2 use Ecto.Migration
3
4 import Ecto.Query, only: [from: 2]
5
6 def up do
7 from(j in "oban_jobs",
8 where:
9 j.queue == ^"background" and
10 fragment("?->>'op'", j.args) in ^[
11 "fetch_data_for_activity",
12 "media_proxy_prefetch",
13 "media_proxy_preload"
14 ] and
15 j.worker == ^"Pleroma.Workers.BackgroundWorker",
16 select: [:id]
17 )
18 |> Pleroma.Repo.delete_all()
19 end
20
21 def down, do: :ok
22 end