repair
Re-queue one or all failed migrations so they can be retried.
Database required: Yes
Usage
bash
# Repair all failed migrations
dbsh repair
# Repair a specific failed migration
dbsh repair --target-version 005Options
| Option | Short | Description |
|---|---|---|
--target-version | -V | Specific version to repair (omit to repair all failed) |
Also accepts global options.
What it does
repair removes the failed record(s) from __migration_history, allowing the migration(s) to be retried on the next dbsh migrate.
Important
repair does NOT undo any database changes the failed script may have made. If the script partially executed before failing, you need to clean up those changes manually before retrying.
When to use
- A migration fails during
dbsh migrate - Fix the SQL in the migration file
- Clean up any partial changes in the database (if applicable)
- Run
dbsh repairto clear the failed state - Run
dbsh migrateagain to retry