Fix oban jobs migrations (especially on PostgreSQL < 12)
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
4f9a03f523
commit
d8323c8e5c
@ -0,0 +1,15 @@
|
||||
defmodule Mobilizon.Storage.Repo.Migrations.FixObanMigrationsForOlderPostgreSQLVersions do
|
||||
use Ecto.Migration
|
||||
|
||||
@disable_ddl_transaction true
|
||||
def up do
|
||||
Ecto.Adapters.SQL.query!(
|
||||
Mobilizon.Storage.Repo,
|
||||
"ALTER TYPE oban_job_state ADD VALUE IF NOT EXISTS 'cancelled'"
|
||||
)
|
||||
end
|
||||
|
||||
def down do
|
||||
IO.puts("This migration doesn't handle being reverted.")
|
||||
end
|
||||
end
|
@ -0,0 +1,6 @@
|
||||
defmodule Mobilizon.Storage.Repo.Migrations.UpgradeObanJobsToV9 do
|
||||
use Ecto.Migration
|
||||
|
||||
defdelegate up, to: Oban.Migrations
|
||||
defdelegate down, to: Oban.Migrations
|
||||
end
|
Loading…
Reference in New Issue
Block a user