from sqlalchemy import Column, String, Integer, Boolean, DateTime, ForeignKey from sqlalchemy.orm import relationship from sqlalchemy.sql import func from core.database import Base import uuid from datetime import datetime class School(Base): __tablename__ = "schools" id = Column(String, primary_key=True, default=lambda: str(uuid.uuid4())) name = Column(String, nullable=False, index=True) address = Column(String, nullable=False) capacity = Column(Integer, nullable=False) storage_type = Column(String, nullable=False) temperature_controlled = Column(Boolean, default=False) security_level = Column(String, nullable=False) is_active = Column(Boolean, default=True) square_footage = Column(Integer, nullable=False) available_space = Column(Integer, nullable=False) created_at = Column(DateTime, default=func.now()) updated_at = Column(DateTime, default=func.now(), onupdate=func.now())