mix ash_onetime.gen.migrations (ash_onetime v0.3.0)

Copy Markdown View Source

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

Use --tenants to write to the repo tenant migration directory.

Summary

Functions

Renders the install migration deterministically for explicit options.

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).

Functions

render(repo, options)

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

Renders the install migration deterministically for explicit options.

render_roll_forward(repo, options)

@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).