# `StatifierPersistence.Ecto.Migrations.V05`
[🔗](https://github.com/riddler/statifier_persistence/blob/v0.25.1/lib/statifier_persistence/ecto/migrations/v05.ex#L2)

V05 of the package DDL: the per-execution input log table (ADR-0010
decision 9).

Four columns beside the surrogate key: `execution_id`, the execution the entry
belongs to; `seq`, its dense zero-based ordinal; `door`, the public
door it entered by (`t:StatifierPersistence.Executions.entry/0`, as a
string); and `input_blob`, the opaque payload the facade encoded above
the adapter. `input_blob` is **nullable**, and a null is not "no
value": it is decision 6's closed marker, written in the cap's last
slot when a host-declared cap is reached.

The unique index on `(execution_id, seq)` is what makes denseness true.
`StatifierPersistence.Storage.Ecto.append_input/3` takes its ordinal
from the execution's current maximum, under the exclusion the append already
runs inside; a lost race then fails the write instead of duplicating an
ordinal, because a gap in a log is a defect and a duplicate is a
silently reordered replay. It doubles as the lookup index: every read
of this table is one execution's whole log in ascending `seq`, which the
index serves directly.

No foreign key to the executions table, for the same reason no other table
here has one: `execution_id` is a caller-supplied opaque string this layer
stores verbatim (ADR-0002 decision 1), and a host's own retention of
executions is not this package's to constrain.

**Every backend, no Postgres-only spelling.** Unlike V03's `GIN`
`jsonb_path_ops` index and V04's concurrent rebuild, there is nothing
here a non-Postgres adapter cannot run: a table, four columns and a
unique index. So this version carries no adapter check and no
`@disable_ddl_transaction` recipe, and SQLite gets the input log on
exactly the terms Postgres does (ADR-0010 decision 9).

`down/1` drops the table, which is the whole of it: V05 adds nothing
to a table another version owns.

The table carries the host's `:leading_columns`, if it configured any,
immediately after `id` and in the order given, on the same terms as
V01's three tables (`StatifierPersistence.Ecto.Migrations.V01`), and
takes `:timestamps_position` and `:column_collations` on those terms
too.

# `down`

```elixir
@spec down(StatifierPersistence.Ecto.Config.t()) :: :ok
```

Drops the input log table.

# `up`

```elixir
@spec up(StatifierPersistence.Ecto.Config.t()) :: :ok
```

Creates the input log table and its unique `(execution_id, seq)` index.

---

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