from sqlalchemy import String, JSON from sqlalchemy.orm import mapped_column, Mapped from database.models.base_model import BaseModel class Airspace(BaseModel): __tablename__ = "airspace" id: Mapped[int] = mapped_column(primary_key=True) country: Mapped[str] = mapped_column(String(8), nullable=False, index=True) name: Mapped[str] = mapped_column(String(128), nullable=False, unique=True) type: Mapped[str] = mapped_column(String(8), nullable=False, index=True) lower_limit: Mapped[str] = mapped_column(String(32), nullable=False) lower_alt_unit: Mapped[str] = mapped_column(String(8), nullable=False) upper_limit: Mapped[str] = mapped_column(String(32), nullable=False) upper_alt_unit: Mapped[str] = mapped_column(String(8), nullable=False) bounds: Mapped[list[tuple[float, float]]] = mapped_column(JSON())