# sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: user

- **ID:** `python/flask-sqlalchemy-no-such-table`
- **Domain:** python
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The database table doesn't exist; migrations not applied or models not created.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   flask db init
flask db migrate -m 'initial'
flask db upgrade
   ```
2. **** (90% success)
   ```
   with app.app_context():
    db.create_all()
   ```

## Dead Ends

- **** — Loses all data; not viable in production. (90% fail)
- **** — May not handle schema changes; not recommended for production. (70% fail)
