QueueKeeperCheck.Ledger.Migration (queue_keeper_check v0.3.0)

Copy Markdown View Source

Creates the opt-in last-seen ledger tables.

Add a migration in the host app and run it yourself; this library never migrates a database on its own:

defmodule MyApp.Repo.Migrations.AddQueueKeeperLedger do
  use Ecto.Migration

  def up, do: QueueKeeperCheck.Ledger.Migration.up()
  def down, do: QueueKeeperCheck.Ledger.Migration.down()
end

Pass prefix: to put the tables in the same schema as that Oban instance (Postgres). The prefix column on each row still stores the Oban prefix, so a single schema can hold more than one instance if you need it.

Tables:

  • queue_keeper_worker_sightings — primary key (prefix, worker), plus last_inserted_at and nullable last_job_id
  • queue_keeper_ledger_meta — primary key prefix, plus started_at (when recording began for that prefix)

Summary

Functions

down(opts \\ [])

up(opts \\ [])