Add Flower model

This commit is contained in:
Backend IM Bot 2025-03-27 10:29:15 +00:00
parent 2fe9f28f68
commit 2d90390508

23
models/flower.py Normal file
View File

@ -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())