Initial commit — PlantGuideScraper project

This commit is contained in:
Trey T
2026-04-12 09:54:27 -05:00
commit 6926f502c5
87 changed files with 29120 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
from sqlalchemy import Column, Integer, String, DateTime, func
from sqlalchemy.orm import relationship
from app.database import Base
class Species(Base):
__tablename__ = "species"
id = Column(Integer, primary_key=True, index=True)
scientific_name = Column(String, unique=True, nullable=False, index=True)
common_name = Column(String, nullable=True)
genus = Column(String, nullable=True, index=True)
family = Column(String, nullable=True)
created_at = Column(DateTime, server_default=func.now())
# Relationships
images = relationship("Image", back_populates="species", cascade="all, delete-orphan")
def __repr__(self):
return f"<Species(id={self.id}, scientific_name='{self.scientific_name}')>"