python
data_error
ai_generated
true
sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: user
ID: python/flask-sqlalchemy-no-such-table
80%Fix Rate
88%Confidence
0Evidence
2025-12-30First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 2.x | active | — | — | — |
| 3.x | active | — | — | — |
Root Cause
The database table doesn't exist; migrations not applied or models not created.
generic中文
数据库表不存在;未应用迁移或未创建模型。
Workarounds
-
95% success
flask db init flask db migrate -m 'initial' flask db upgrade
-
90% success
with app.app_context(): db.create_all()
Dead Ends
Common approaches that don't work:
-
90% fail
Loses all data; not viable in production.
-
70% fail
May not handle schema changes; not recommended for production.