mirror of
https://github.com/sstent/foodplanner.git
synced 2025-12-06 08:01:47 +00:00
added alembic database migrations, json import/export
This commit is contained in:
@@ -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",
|
||||
]
|
||||
}
|
||||
|
||||
9
main.py
9
main.py
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user