Generates an Ecto migration that installs PgFlow's extension SQL functions.
Usage
mix pgflow.gen.helpers_migration
mix pgflow.gen.helpers_migration --migrations-path priv/repo/migrationsOptions
--migrations-path- Path to the migrations directory. Defaults topriv/repo/migrations.
Generated Functions
This migration creates PostgreSQL functions in the pgflow schema:
Read Functions
get_flow_input(uuid)- Get flow run input dataflow_exists(text)- Check if flow existsget_step_output(uuid, text)- Get step output
Write Functions
register_worker(uuid, text, text)- Register or heartbeat a workermark_worker_stopped(uuid)- Mark worker as stoppedrecover_stalled_tasks(double precision)- Recover stalled tasks
Requirements
The pgflow schema must already exist. Run pgflow migrations first if needed.
Example
# Generate the migration
$ mix pgflow.gen.helpers_migration
# Run the migration
$ mix ecto.migrate