v0.2 - 19 features: comparator, allergies, gamification, shopping list, achievements, stats, profile, share, bottom nav
This commit is contained in:
12
backend/app/models/shopping_list.py
Normal file
12
backend/app/models/shopping_list.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from sqlalchemy import Column, Integer, String, DateTime, ForeignKey, Boolean
|
||||
from datetime import datetime, timezone
|
||||
from app.database import Base
|
||||
|
||||
class ShoppingItem(Base):
|
||||
__tablename__ = "shopping_list"
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
user_id = Column(Integer, ForeignKey("users.id"), nullable=False)
|
||||
product_name = Column(String, nullable=False)
|
||||
barcode = Column(String, nullable=True)
|
||||
checked = Column(Boolean, default=False)
|
||||
added_at = Column(DateTime(timezone=True), default=lambda: datetime.now(timezone.utc))
|
||||
Reference in New Issue
Block a user