Skip to content

spawn migration adopt

Usage

spawn migration adopt [migration] [options]

Records a migration as applied in _spawn.migration_history without executing the SQL. Useful when migrations were applied manually or through other means.

  • [migration] — Optional. Specific migration to adopt. If omitted, adopts all pending migrations.
  • Migrations were run manually via psql
  • Database was created from a backup that includes newer schema
  • Initial setup where migrations don’t need to run but should be tracked

Adoption creates a history entry with:

  • Status: success
  • Activity: ADOPT
  • Optional description explaining why it was adopted

Adopt a specific migration:

Terminal window
spawn migration adopt 20260131120000-add-users-table \
--description "Applied manually via psql"

Adopt all pending migrations:

Terminal window
spawn migration adopt --yes

Options

Option Description
--yes Skip confirmation prompt
--description <text> Reason for adoption (recorded in history)
-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.