prop/priv/repo/migrations/20260430142341_oban_pro_v1_7.exs
Graham McIntire 3c988a5ff3
deps: oban_pro 1.6.14 (vendored) → 1.7.0 (hex)
Oban Pro 1.7.0 ships database-backed workflow tracking, replaces the
generated `uniq_key` / `partition_key` columns with expression
indexes, and adds new partial indexes for query performance.

Switches oban_pro from the vendor/ tree to the licensed `oban` hex
repo (auth already configured via `mix hex.repo`). vendor/oban_pro
deleted — the vendoring was a 1.6.x stopgap, 1.7 is the first
version we land directly from hex.

oban_met (1.1.0) and oban_web (2.12.1) stay vendored — they're
not published to the licensed `oban` repo (verified by 404 on
`mix hex.package fetch`).

Migration 20260430142341 runs `Oban.Pro.Migration.up(version: "1.7.0")`
which creates the workflow tables and the new indexes. Verified on
dev + test DBs. Production is well below the size threshold the v1.7
guide flags for split-migration handling, so the inline default
suffices.

No code changes for the breaking-change list — the codebase only
references Oban.Pro.Engines.Smart and Oban.Pro.Plugins.DynamicLifeline,
both unchanged in 1.7. We don't use Workflow.after_cancelled/2 or
Oban.Pro.Workers.Chunk.

Test suite stays at 3132/3132.
2026-04-30 09:25:11 -05:00

26 lines
1.1 KiB
Elixir

defmodule Microwaveprop.Repo.Migrations.ObanProV17 do
@moduledoc """
Oban Pro 1.7 schema migration. Per the v1.7 upgrade guide:
* Adds the database-backed workflow tracking tables.
* Replaces the legacy generated `uniq_key` / `partition_key`
columns with expression indexes (faster + reclaims storage).
* Adds new partial indexes for improved query performance.
* Renames the legacy workflow indexes with an `_old` suffix —
a follow-up migration can drop them once we're confident the
new indexes are healthy.
The 1.7 release docs note that for very large `oban_jobs` tables,
the schema and index work should be split into separate migrations
with DDL transactions disabled for the index half. Our prod
`oban_jobs` table holds at most a few hours of jobs (Pruner runs
daily, max_age 24h) so the inline default is fine — we're nowhere
near the size where Postgres would lock-storm on a regular index
CREATE.
"""
use Ecto.Migration
def up, do: Oban.Pro.Migration.up(version: "1.7.0")
def down, do: Oban.Pro.Migration.down(version: "1.7.0")
end