Fix: Add database table initialization on startup
Browse files- app/main.py +4 -0
app/main.py
CHANGED
|
@@ -58,6 +58,10 @@ async def health_check():
|
|
| 58 |
@app.on_event("startup")
|
| 59 |
async def startup_event():
|
| 60 |
logger.info("Universal Model Trainer starting up...")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
logger.info("Routers registered: models, datasets, training, system, jobs")
|
| 62 |
|
| 63 |
@app.on_event("shutdown")
|
|
|
|
| 58 |
@app.on_event("startup")
|
| 59 |
async def startup_event():
|
| 60 |
logger.info("Universal Model Trainer starting up...")
|
| 61 |
+
# Initialize database tables
|
| 62 |
+
from app.database import init_db
|
| 63 |
+
await init_db()
|
| 64 |
+
logger.info("Database tables initialized")
|
| 65 |
logger.info("Routers registered: models, datasets, training, system, jobs")
|
| 66 |
|
| 67 |
@app.on_event("shutdown")
|