# alembic.util.exc.CommandError: Multiple head revisions are present for given argument 'head'; please specify a specific target revision.

- **ID:** `python/sqlalchemy-multiple-heads-in-migration`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The Alembic migration history has diverged, resulting in multiple branch heads.

## Version Compatibility

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

## Workarounds

1. **Merge the heads using alembic merge** (95% success)
   ```
   alembic merge heads -m "merge heads"
   ```
2. **Specify the exact revision to upgrade to** (85% success)
   ```
   alembic upgrade <revision_id>
   ```

## Dead Ends

- **Deleting one of the migration files** — This can break the migration chain and cause database inconsistency. (80% fail)
- **Running alembic upgrade head without specifying** — Alembic cannot determine which head to upgrade to. (90% fail)
