Upgrading to v2.21

View Source

This release requires PostgreSQL 14+ and includes an optional migration to add the suspended job state.

Oban v2.21 requires PostgreSQL 14 or later. PostgreSQL 12 reached end of life in November 2024, and PostgreSQL 13 reached end of life in November 2025. If you're running an older version, you'll need to upgrade PostgreSQL before upgrading Oban.

Bump Your Deps

Update Oban (and optionally Pro) to the latest versions:

[
  {:oban, "~> 2.21"},
]

Run Oban.Migrations for v14 (Optional)

The v14 migration adds the suspended state to the oban_job_state enum. The suspended state allows jobs to be held without processing until they are explicitly resumed. While not used directly by Oban itself, it enables Pro workflows to efficiently defer job execution.

To get started, create a migration:

mix ecto.gen.migration upgrade_oban_jobs_to_v14

Within the generated migration module:

use Ecto.Migration

def up, do: Oban.Migrations.up(version: 14)

def down, do: Oban.Migrations.down(version: 14)

If you have multiple Oban instances or use an alternate prefix, you'll need to run the migration for each prefix.