From 2d903905082c6851c451ad0419cfe70067414b3f Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Thu, 27 Mar 2025 10:29:15 +0000 Subject: [PATCH] Add Flower model --- models/flower.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 models/flower.py diff --git a/models/flower.py b/models/flower.py new file mode 100644 index 0000000..16dea8a --- /dev/null +++ b/models/flower.py @@ -0,0 +1,23 @@ +from sqlalchemy import Column, String, Integer, Boolean, DateTime, Text +from sqlalchemy.orm import relationship +from sqlalchemy.sql import func +from core.database import Base +import uuid + +class Flower(Base): + __tablename__ = "flowers" + + id = Column(String, primary_key=True, default=lambda: str(uuid.uuid4())) + name = Column(String, nullable=False, index=True) + scientific_name = Column(String, nullable=True) + description = Column(Text, nullable=True) + color = Column(String, nullable=True) + bloom_season = Column(String, nullable=True) + height = Column(Integer, nullable=True) + sunlight_needs = Column(String, nullable=True) + water_needs = Column(String, nullable=True) + is_perennial = Column(Boolean, default=True) + hardiness_zone = Column(String, nullable=True) + + created_at = Column(DateTime, default=func.now()) + updated_at = Column(DateTime, default=func.now(), onupdate=func.now()) \ No newline at end of file