PgFlow.Migrations.Versions.V03 (PgFlow v0.2.0)

Copy Markdown View Source

PgFlow extensions migration version 3.

Adds attempts_count to the step_task_record composite type and replaces start_tasks with the upstream body plus that column, so a dispatched task carries the attempt it is on and PgFlow.Context.attempt can stop reporting a hardcoded 1.

Deploy the worker before applying this: PgFlow.Worker.TaskRow reads both the seven- and eight-column row, but a worker that predates it matches seven positionally and would fail every dispatch against the wider record. See priv/pgflow_helpers/sql/versions/v03/v03_up.sql for why the returned value is the stored count plus one.

Summary

Functions

Rolls back this version's migration by executing the down SQL file.

Applies this version's migration by executing the up SQL file.

Functions

down(opts \\ [])

@spec down(keyword()) :: :ok

Rolls back this version's migration by executing the down SQL file.

up(opts \\ [])

@spec up(keyword()) :: :ok

Applies this version's migration by executing the up SQL file.