21 lines
881 B
Python
21 lines
881 B
Python
from sqlalchemy import Column, String, Integer, Boolean, DateTime, ForeignKey, Float, Text, JSON, Date, Time, Enum
|
|
from sqlalchemy.dialects.postgresql import UUID
|
|
from sqlalchemy.orm import relationship
|
|
from sqlalchemy.sql import func
|
|
from core.database import Base
|
|
import uuid
|
|
from datetime import datetime
|
|
|
|
class Meal(Base):
|
|
__tablename__ = "meals"
|
|
|
|
id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
|
|
name = Column(String, nullable=False)
|
|
description = Column(Text, nullable=True)
|
|
price = Column(Float, nullable=False)
|
|
is_available = Column(Boolean, default=True)
|
|
category = Column(String, nullable=True)
|
|
cuisine = Column(String, nullable=True)
|
|
dietary_restrictions = Column(JSON, nullable=True)
|
|
created_at = Column(DateTime, default=func.now())
|
|
updated_at = Column(DateTime, default=func.now(), onupdate=func.now()) |