19 lines
717 B
Python
19 lines
717 B
Python
"""Meal model."""
|
|
from sqlalchemy import Column, Integer, String, DateTime, Text
|
|
from datetime import datetime
|
|
from app.core.database import Base
|
|
|
|
class Meal(Base):
|
|
"""Meal model for menu planning."""
|
|
__tablename__ = "meals"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
title = Column(String(200), nullable=False)
|
|
description = Column(Text)
|
|
meal_type = Column(String(20)) # breakfast, lunch, dinner, snack
|
|
scheduled_date = Column(DateTime)
|
|
mealie_recipe_id = Column(String(100)) # Link to Mealie recipe
|
|
notes = Column(Text)
|
|
created_at = Column(DateTime, default=datetime.utcnow)
|
|
updated_at = Column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow)
|