# django.db.migrations.exceptions.NodeNotFoundError: Migration myapp.0002_auto depends on nonexistent node ('other_app', '0001_initial')

- **ID:** `python/pytest-django-migration-test`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A migration file references a dependency that doesn't exist. This can happen if the other app is not installed, the migration was deleted, or there's a circular dependency.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   Check INSTALLED_APPS and run makemigrations for missing apps.
   ```
2. **** (90% success)
   ```
   Edit the migration's dependencies list to reference the correct app and migration.
   ```
3. **** (80% success)
   ```
   python manage.py migrate --fake-initial
   ```

## Dead Ends

- **** — This may break the migration history and cause other issues. (90% fail)
- **** — This marks migrations as applied without actually creating tables, leading to database inconsistencies. (85% fail)
- **** — The app must have its migrations to satisfy the dependency. (80% fail)
