mix outbox.gen.migration (Outbox v0.1.0-beta.1)

Copy Markdown View Source

Generates the outbox_events table migration in the host's priv/repo/migrations/ directory.

Examples

mix outbox.gen.migration
mix outbox.gen.migration --prefix tenant

Options

  • --prefix - Postgres schema prefix to use. Defaults to "public".
  • --repo - the Repo to introspect for the migrations path. Defaults to the first repo in :ecto_repos config.

Summary

Functions

Renders the migration body. Exposed so the generator's test can verify the canonical template without writing to disk.

Writes a migration to the given directory. The timestamp_fun allows tests to inject a deterministic timestamp.

Functions

render(opts)

@spec render(keyword()) :: String.t()

Renders the migration body. Exposed so the generator's test can verify the canonical template without writing to disk.

write_migration(dir, prefix, timestamp_fun)

@spec write_migration(Path.t(), String.t(), (-> String.t())) :: Path.t()

Writes a migration to the given directory. The timestamp_fun allows tests to inject a deterministic timestamp.