Migrations after Oban 2.11

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2022-03-21 16:53:10 +01:00
parent edbe6ee21a
commit 4b7498c67e
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773
2 changed files with 32 additions and 0 deletions

View file

@ -0,0 +1,7 @@
defmodule Mobilizon.Storage.Repo.Migrations.CreateObanPeers do
use Ecto.Migration
def up, do: Oban.Migrations.up(version: 11)
def down, do: Oban.Migrations.down(version: 11)
end

View file

@ -0,0 +1,25 @@
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