Add Fruit model

This commit is contained in:
Backend IM Bot 2025-03-26 02:37:49 +00:00
parent 64848f2488
commit 825745c7aa

View File

@ -6,6 +6,6 @@ import uuid
class Fruit(Base):
__tablename__ = "fruits"
id = Column(String, primary_key=True, default=lambda: str(uuid.uuid4()))
name = Column(String, nullable=False, index=True)
name = Column(String, unique=True, nullable=False, index=True)
created_at = Column(DateTime, default=func.now())
updated_at = Column(DateTime, default=func.now(), onupdate=func.now())