mirror of
https://framagit.org/framasoft/mobilizon.git
synced 2024-12-24 08:54:08 +00:00
Merge branch 'fix-oban-migration' into 'master'
Fix oban jobs migrations (especially on PostgreSQL < 12) See merge request framasoft/mobilizon!701
This commit is contained in:
commit
95dafcecee
2 changed files with 21 additions and 0 deletions
|
@ -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 a new issue