mix pgflow.gen.postgres_extensions_migration (PgFlow v0.1.0)

Copy Markdown View Source

Generates a single Ecto migration that runs CREATE EXTENSION for the Postgres extensions pgflow relies on.

Defaults to: citext, pg_trgm, pgcrypto, pg_cron.

Pairs with mix pgflow.setup (installs the pgflow schema) and mix pgflow.gen.pgmq_migration (installs pgmq via SQL-only method, which is the portable path for pgmq since most Postgres distributions don't ship it as a native extension).

Usage

mix pgflow.gen.postgres_extensions_migration
mix pgflow.gen.postgres_extensions_migration --repo MyApp.OtherRepo
mix pgflow.gen.postgres_extensions_migration --no-cron

Options

  • --repo - Ecto repo module to generate the migration for. Defaults to the first entry in config :my_app, ecto_repos: [...].

  • --no-cron - Skip pg_cron. Use on managed Postgres hosts that don't permit it. Default: pg_cron is included (pgflow schedules cron-based flows via pg_cron).

pgmq note

pgmq is NOT included in this task. On most Postgres distributions pgmq isn't available as a native extension — use mix pgflow.gen.pgmq_migration to install it via SQL-only method. On environments where pgmq IS pre-built (Supabase, atlas-postgres-pgflow), hand-edit the generated migration to add execute("CREATE EXTENSION IF NOT EXISTS pgmq").

Migration order

This migration should run BEFORE mix pgflow.gen.pgmq_migration's output and before mix pgflow.setup's output:

  1. install_extensions (this task)
  2. install_pgmq (from mix pgflow.gen.pgmq_migration, if needed)
  3. setup_pgflow (from mix pgflow.setup)