File size: 707 Bytes
fdc2693
 
b938416
fdc2693
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# backend/app/models/nutrition.py
from sqlalchemy import Column, Integer, String, Float, JSON
from database import Base

class Nutrition(Base):
    __tablename__ = "nutrition"

    id = Column(Integer, primary_key=True, index=True)
    food_name = Column(String, unique=True, index=True, nullable=False)
    chinese_name = Column(String)
    calories = Column(Float)
    protein = Column(Float)
    fat = Column(Float)
    carbs = Column(Float)
    fiber = Column(Float)
    sugar = Column(Float)
    sodium = Column(Float)
    # For more complex data like vitamins, minerals, etc.
    details = Column(JSON)
    health_score = Column(Integer)
    recommendations = Column(JSON)
    warnings = Column(JSON)