Add FoodLog model and update relationships

Introduces the FoodLog model to track user food consumption, adds relationships between User, FoodItem, and FoodLog, and updates seed.py to include sample FoodLog data. Also fixes route redirection to use the correct blueprint namespace.
This commit is contained in:
2025-07-01 13:06:26 +02:00
parent f2fd288bd7
commit 7bf8a754db
3 changed files with 32 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
from application import db, app
from models import User, FoodItem
from models import User, FoodItem, FoodLog
with app.app_context():
User.query.delete()
@@ -21,4 +21,7 @@ with app.app_context():
)
)
FoodLog.query.delete()
db.session.add(FoodLog(1, 1, 200))
db.session.commit()