from __future__ import annotations import uuid from datetime import datetime, timezone from sqlalchemy import DateTime, String from sqlalchemy.orm import Mapped, mapped_column from .base import Base class Host(Base): """A registered host. Reachability/DNS/HTTP checks are now separate Monitor rows that link back via Monitor.host_id — a Host is just identity + address. """ __tablename__ = "hosts" id: Mapped[str] = mapped_column(String(36), primary_key=True, default=lambda: str(uuid.uuid4())) name: Mapped[str] = mapped_column(String(128), nullable=False) address: Mapped[str] = mapped_column(String(255), nullable=False) created_at: Mapped[datetime] = mapped_column( DateTime(timezone=True), nullable=False, default=lambda: datetime.now(timezone.utc) )