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

V02 of the package DDL: the nullable `metadata` `jsonb` column on the
executions table (ADR-0006 decision 3, decision 4's migration shape).

Nullable, because an execution created with no metadata stores none, and
ADR-0006 decision 3 makes the empty map the never-refused default -
a `NOT NULL` column would turn "no metadata" into a write this package
would have to invent a value for.

**No index.** Which key/value pairs a host queries by, and therefore
which expression or GIN index it wants, is the host's call and not
something this package can guess (ADR-0006 decision 4). A host that
queries the column at any volume adds its own index in its own
migration; `StatifierPersistence.Storage.Ecto.list_executions_by_metadata/2`
issues a `jsonb` containment query a GIN index on the column serves
directly.

`:blob_type` does not reach this column and never will: it is a
queryable column, not a blob, which is exactly why ADR-0006 decision 2
admits host identities into it and nothing else.

# `down`

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

Drops the executions table's `metadata` column.

# `up`

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

Adds the executions table's nullable `metadata` jsonb column per `config`.

---

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