mobilizon.chapril.org-mobil.../priv/repo/migrations/20220321154142_swap_primary_oban_indexes.exs
Thomas Citharel 4b7498c67e
Migrations after Oban 2.11
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2022-03-21 16:55:01 +01:00

26 lines
515 B
Elixir

defmodule Mobilizon.Storage.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],
prefix: "public"
)
)
end
end