mirror of
https://github.com/StefBuwalda/cal_counter.git
synced 2025-10-29 19:00:00 +00:00
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:
5
seed.py
5
seed.py
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user