Add Meal model
This commit is contained in:
18
backend/app/models/meal.py
Normal file
18
backend/app/models/meal.py
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
"""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)
|
||||||
Reference in New Issue
Block a user