added alembic database migrations, json import/export

This commit is contained in:
2025-09-28 13:23:03 -07:00
parent 35dded5045
commit 1122c169da
2 changed files with 2 additions and 9 deletions

View File

@@ -56,7 +56,7 @@ job "foodplanner" {
# Mount the SQLite database file to persist data
# Adjust the source path as needed for your environment
volumes = [
"/alloc/tmp/:/data/",
"/alloc/tmp/:/app/data/",
"/mnt/Public/configs/FoodPlanner_backups:/backups",
]
}

View File

@@ -324,14 +324,7 @@ def scheduled_backup():
@app.on_event("startup")
def startup_event():
logging.info("FastAPI application startup event triggered.")
try:
run_migrations()
logging.info("Database migrations completed successfully in startup_event.")
except Exception as e:
logging.error(f"Error during database migrations in startup_event: {e}")
# Depending on severity, you might want to re-raise or handle differently
# raise
run_migrations()
# Schedule the backup job
scheduler = BackgroundScheduler()