mobilizon.chapril.org-mobil.../priv/repo/migrations/20201114174929_fix_oban_migrations_for_older_postgre_sql_versions.exs
Thomas Citharel d8323c8e5c
Fix oban jobs migrations (especially on PostgreSQL < 12)
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2020-11-14 18:55:14 +01:00

16 lines
385 B
Elixir

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