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.
Arguments
Section titled “Arguments”[migration]— Optional. Specific migration to adopt. If omitted, adopts all pending migrations.
Use cases
Section titled “Use cases”- 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
Behavior
Section titled “Behavior”Adoption creates a history entry with:
- Status:
success - Activity:
ADOPT - Optional description explaining why it was adopted
Examples
Section titled “Examples”Adopt a specific migration:
spawn migration adopt 20260131120000-add-users-table \ --description "Applied manually via psql"Adopt all pending migrations:
spawn migration adopt --yesOptions
| 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. |