Generates an Ecto migration in the consumer app that installs the pgflow
schema by calling PgFlow.Migration.up/0 and PgFlow.HelpersMigration.up/0
(and optionally PgFlowDashboard.Migration.up/0) in the correct order.
This mirrors mix tango.setup and mix good_analytics.setup. The output
is a single wrapper migration, not per-statement migrations — SQL is
vendored inside pgflow.
Usage
mix pgflow.setup
mix pgflow.setup --repo MyApp.OtherRepo
mix pgflow.setup --no-helpers
mix pgflow.setup --dashboardOptions
--repo- Ecto repo module to install against. Defaults to the first entry inconfig :my_app, ecto_repos: [...].--no-helpers- SkipPgFlow.HelpersMigration(Elixir-binding SQL helpers: worker registration, flow input/output queries). Default: helpers are installed.--dashboard- Also installPgFlowDashboard.Migration(dashboard views). Default: skipped. Add this if you use the PgFlow LiveView dashboard.
Prerequisites
Before mix ecto.migrate picks up the generated migration, the consumer
must have:
- pgmq installed (run
mix pgflow.gen.pgmq_migrationto generate a migration that installs pgmq via SQL-only method — required unless your Postgres already provides pgmq, e.g. Supabase). pg_cronextension registered (CREATE EXTENSION pg_cronin an earlier migration).citext,pg_trgm,pgcryptoextensions registered.
The typical migration order is:
install_extensions(citext, pg_trgm, pgcrypto, pg_cron)install_pgmq(frommix pgflow.gen.pgmq_migration)setup_pgflow(this task)