Skip to content

spawn migration new

Usage

spawn migration new <name>

Creates a new timestamped migration directory with a template up.sql file.

  • <name> — A descriptive name for the migration (e.g., add-users-table)

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.

migrations/20260131120000-add-users-table/up.sql
spawn migration new add-users-table

Options

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.