chore(home): mirror from kalinamall (9883e6a) with papatramp URLs

This commit is contained in:
2026-07-14 20:43:52 +10:00
commit ed4e78f6c3
312 changed files with 42790 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
from datetime import datetime
from sqlalchemy import DateTime, ForeignKey, String, Text, UniqueConstraint, func
from sqlalchemy.dialects.postgresql import JSONB
from sqlalchemy.orm import Mapped, mapped_column, relationship
from app.database import Base
class Event(Base):
__tablename__ = "events"
__table_args__ = (UniqueConstraint("event_id", name="uq_events_event_id"),)
id: Mapped[int] = mapped_column(primary_key=True, autoincrement=True)
event_id: Mapped[str] = mapped_column(String(36), index=True)
host_id: Mapped[int] = mapped_column(ForeignKey("hosts.id"), index=True)
occurred_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), index=True)
received_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now())
category: Mapped[str] = mapped_column(String(64), index=True)
type: Mapped[str] = mapped_column(String(128), index=True)
severity: Mapped[str] = mapped_column(String(16), index=True)
title: Mapped[str] = mapped_column(String(256))
summary: Mapped[str] = mapped_column(Text)
details: Mapped[dict | None] = mapped_column(JSONB)
raw: Mapped[dict | None] = mapped_column(JSONB)
dedup_key: Mapped[str | None] = mapped_column(String(512), index=True)
correlation_id: Mapped[str | None] = mapped_column(String(36))
payload: Mapped[dict] = mapped_column(JSONB)
host: Mapped["Host"] = relationship(back_populates="events")