# `PhoenixKit.Migrations.Postgres.V27`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.87/lib/phoenix_kit/migrations/postgres/v27.ex#L1)

Migration V27: Add Oban tables for background job processing.

This migration creates Oban tables required for background job processing,
including file processing (storage system) and email handling.

## Changes
- Creates `oban_jobs` table for job queue management
- Creates `oban_peers` table for distributed coordination
- Adds indexes for efficient job processing
- Sets up Oban schema to latest version (uses Oban.Migration.up/1)

## Requirements
- PostgreSQL database
- Oban dependency (`{:oban, "~> 2.17"}`)

## Purpose
- Enable background job processing for:
  - File variant generation (thumbnails, resizes)
  - Video processing (transcoding, thumbnails)
  - Email sending and tracking
  - Metadata extraction (dimensions, duration, EXIF)
  - Multi-bucket redundancy uploads

## Queue Configuration
After running this migration, configure Oban queues in config/config.exs:

    config :phoenix_kit, Oban,
      repo: MyApp.Repo,
      queues: [
        default: 10,
        emails: 50,
        file_processing: 20
      ],
      plugins: [Oban.Plugins.Pruner]

## Notes
- Oban tables are created in the same schema prefix as PhoenixKit tables
- Uses Oban's latest schema version automatically (forward-compatible)
- Idempotent: Safe to run multiple times

# `down`

# `up`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
