# alembic.util.exc.CommandError: Can't locate revision identified by 'abc123'

- **ID:** `python/flask-migrate-downgrade-error`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Flask-Migrate cannot find a specific migration revision in the migrations folder.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.x | active | — | — |

## Workarounds

1. **Check the migration history and use a valid revision** (90% success)
   ```
   flask db history
flask db downgrade <valid_revision>
   ```
2. **Recreate the migration from scratch if necessary** (85% success)
   ```
   flask db stamp head
flask db migrate
flask db upgrade
   ```

## Dead Ends

- **Deleting the migrations folder and starting over** — Loses all migration history; may cause data loss. (70% fail)
- **Manually editing the migration files** — Can cause inconsistency; error-prone. (80% fail)
