spawn migration build
Usage
spawn migration build <migration> [--pinned] [--variables <path>] Renders a migration’s up.sql template into final SQL, resolving component includes and template variables. Outputs to stdout.
Arguments
Section titled “Arguments”<migration>— The migration directory name
Behavior
Section titled “Behavior”- Loads the migration’s
up.sqltemplate - Resolves component includes from
components/(orpinned/if--pinned) - Injects template variables from config or
--variablesfile - Renders final SQL to stdout
Without --pinned, the migration uses the current working tree versions of components. With --pinned, it uses the locked versions from the migration’s lock.toml.
Examples
Section titled “Examples”Build with current components:
spawn migration build 20260131120000-add-users-tableBuild with pinned components:
spawn migration build 20260131120000-add-users-table --pinnedBuild with custom variables:
spawn migration build 20260131120000-add-users-table --variables ./prod-vars.jsonOptions
| Option | Description |
|---|---|
--pinned | Use pinned component versions from lock.toml |
--variables <path> | Path to variables file (JSON, TOML, or YAML). Values are available in templates under {{ variables }}. |
-e, --environment <name> | Override the environment for the target config. |
--target <name> | Select which target from spawn.toml to use. |
--config-file <path> | Path to config file. Defaults to spawn.toml. |
-d, --debug | Turn on debug output. |