spawn migration new
Usage
spawn migration new <name> Creates a new timestamped migration directory with a template up.sql file.
Arguments
Section titled “Arguments”<name>— A descriptive name for the migration (e.g.,add-users-table)
Behavior
Section titled “Behavior”The command creates a new directory at migrations/YYYYMMDDHHMMSS-<name>/ with an up.sql template:
BEGIN;
COMMIT;The timestamp prefix ensures migrations are applied in chronological order.
Example
Section titled “Example”spawn migration new add-users-tableOptions
| Option | Description |
|---|---|
-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. |