# `PgFlow.Migrations.Versions.V02`
[🔗](https://github.com/agoodway/pgflow/blob/v0.3.1/lib/pgflow/migrations/versions/v02.ex#L1)

PgFlow extensions migration version 2.

Replaces `recover_stalled_tasks(double precision)` with a step-aware
implementation: it deadlines on each task's effective timeout
(`coalesce(step.opt_timeout, flow.opt_timeout)`) plus a buffer, caps requeues
at 3 (then archives the message and sets `permanently_stalled_at`), takes
`FOR UPDATE SKIP LOCKED`, and skips tasks whose run has failed. See
`priv/pgflow_helpers/sql/versions/v02/v02_up.sql` for the rationale and how it
differs from upstream pgflow's `requeue_stalled_tasks()`.

# `down`

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

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

# `up`

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

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

---

*Consult [api-reference.md](api-reference.md) for complete listing*
