# django.db.migrations.exceptions.MigrationSchemaMissing: Unable to create the django_migrations table (database is read-only)

- **ID:** `python/django-migration-unapplied-error`
- **Domain:** python
- **Category:** system_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Database user lacks permission to create tables, or database is in read-only mode.

## Version Compatibility

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

## Workarounds

1. **** (90% success)
   ```
   Grant necessary permissions to the database user: GRANT ALL ON database.* TO 'user'@'localhost'
   ```
2. **** (85% success)
   ```
   Check database connection settings and ensure the user has write access.
   ```

## Dead Ends

- **** — Does not solve permission issues; may still fail. (80% fail)
- **** — Data loss; not a viable solution in production. (90% fail)
