# `mix ash_onetime.gen.migrations`
[🔗](https://github.com/baselabs/ash_onetime/blob/v1.9.2/lib/mix/tasks/ash_onetime.gen.migrations.ex#L1)

Generates the PostgreSQL objects required by `ash_onetime`.

    mix ash_onetime.gen.migrations --repo MyApp.Repo
    mix ash_onetime.gen.migrations --repo MyApp.Repo --claims hash --claim-partitions 8
    mix ash_onetime.gen.migrations --repo MyApp.Repo --fact-tables ledger_facts,payment_facts

`--fact-tables` additionally generates the append-only fact tables backing
`context_boundary` declarations (one migration creating every named table).
Use `--tenants` to write to the repo tenant migration directory.

# `render`

```elixir
@spec render(module(), keyword()) :: binary()
```

Renders the install migration deterministically for explicit options.

# `render_fact_tables`

```elixir
@spec render_fact_tables(module(), keyword()) :: binary()
```

Renders the context-boundary fact-table migration deterministically for explicit
options. Every table name is validated by
`AshOnetime.Resource.ContextBoundary.validate_fact_table/1`; the migration creates
each table (identity `seq`, GIN-indexed `tags`, tenant scoping, append-only trigger)
and is reversible. Pure (no filesystem writes).

# `render_logical_partition_upgrade`

```elixir
@spec render_logical_partition_upgrade(module(), keyword()) :: binary()
```

Renders the reversible logical-partition upgrade for an existing installation.

# `render_roll_forward`

```elixir
@spec render_roll_forward(module(), keyword()) :: binary()
```

Renders the SEC-5/SEC-6 forward migration deterministically for existing installs: the
response_partition index, a back-fill of monthly partitions from `partition_start` through
`partition_start + months`, and the past-retention DEFAULT drain. Pure (no filesystem writes).

---

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