diff options
Diffstat (limited to 'priv/repo/migrations/20221103014728_swap_primary_oban_indexes.exs')
| -rw-r--r-- | priv/repo/migrations/20221103014728_swap_primary_oban_indexes.exs | 26 | 
1 files changed, 26 insertions, 0 deletions
diff --git a/priv/repo/migrations/20221103014728_swap_primary_oban_indexes.exs b/priv/repo/migrations/20221103014728_swap_primary_oban_indexes.exs new file mode 100644 index 000000000..54e2503de --- /dev/null +++ b/priv/repo/migrations/20221103014728_swap_primary_oban_indexes.exs @@ -0,0 +1,26 @@ +defmodule Pleroma.Repo.Migrations.SwapPrimaryObanIndexes do +  use Ecto.Migration + +  @disable_ddl_transaction true +  @disable_migration_lock true + +  def change do +    create_if_not_exists( +      index( +        :oban_jobs, +        [:state, :queue, :priority, :scheduled_at, :id], +        concurrently: true, +        prefix: "public" +      ) +    ) + +    drop_if_exists( +      index( +        :oban_jobs, +        [:queue, :state, :priority, :scheduled_at, :id], +        concurrently: true, +        prefix: "public" +      ) +    ) +  end +end  | 
