Skip to main content
Roll back migrations for every module that defines a bin/migration/down.ts script. Each module’s rollback script is run from its own directory. By default only the most recently applied migration is rolled back; pass --version to roll back the single migration with that version. Each rollback runs the migration’s down() inside a transaction and removes its row from the migrations table, so a later migration:up re-applies it.

Usage

talos migration:down [options]

Examples

Roll back the most recently applied migration:
talos migration:down
Roll back a specific migration by its version (the timestamp in the Migration<version>.ts filename returned by getVersion()):
talos migration:down --version=20240101120000

Options

OptionDescriptionDefault
--versionVersion of the migration to roll back. When omitted, the most recently applied migration is rolled back.latest
Rolling back relies on a correct down(). If down() does not exactly reverse up(), prefer adding a new corrective migration over a rollback on shared data.

AI Skill

This command ships a matching database:migrate skill. It teaches your AI agent to drive the database lifecycle — applying and rolling back migrations, reseeding, and verifying the schema matches the entities.
talos claude:init