Verifies that the pgflow database schema exists and is compatible with this version of the Elixir implementation.
Usage
mix pgflow.check_schema [options]Options
--repo- The Ecto repo to check. Default: reads from config--notify-trigger-deferred(default) orpgmq_default, matching the app'sPgFlow.Config:notify_triggersetting
Examples
mix pgflow.check_schema
mix pgflow.check_schema --repo MyApp.Repo
mix pgflow.check_schema --notify-trigger pgmq_defaultWhat It Checks
- The
pgflowschema and required tables exist - Installed core and helpers versions meet the bundled minimums
- Required function signatures: five-argument
start_tasks/5,ensure_flow_compiled/4, and no obsolete three-argument claim - Queue identity constraints on
step_tasksandsteps - Eight-field
step_task_recordlayout includingattempts_count - Task status enum includes
skippedandcancelled - pgmq extension is available
When those checks pass, it also prints warnings, without failing, for advisory findings:
- pgmq notify triggers on flow queues (
lower(flow_slug)) that are notDEFERRABLE INITIALLY DEFERRED. Workers usingsignal_strategy: :notifyrecreate them deferred on boot; an immediate trigger makes producers hold the queue's notify throttle row lock until their transaction commits.pgmq.enable_notify_insertand pgmq upgrades that rebuild notify triggers (ALTER EXTENSION pgmq UPDATE, for example to 1.13.1) recreate them immediate. Pass--notify-trigger pgmq_defaultwhen the app configuresnotify_trigger: :pgmq_defaultto skip this warning. - Notify triggers on flow queues with no
pgmq.notify_insert_throttlerow. pgmq keeps that table UNLOGGED, so crash recovery and Neon compute restarts empty it, and a trigger without its row sends no NOTIFY until a worker boot orPgFlow.Signal.Notifyrestores the row. - Notify triggers on partitioned flow queue tables when the installed pgmq (before 1.13.1) cannot resolve a partition to its queue, so those queues never send NOTIFY.
See docs/UPSTREAM_COMPATIBILITY.md for the full contract.