diff --git a/decnet/web/db/models/orchestrator.py b/decnet/web/db/models/orchestrator.py index ac71b7ba..5d217eab 100644 --- a/decnet/web/db/models/orchestrator.py +++ b/decnet/web/db/models/orchestrator.py @@ -41,12 +41,14 @@ class OrchestratorEvent(SQLModel, table=True): kind: str = Field(index=True, max_length=16) # traffic|file protocol: str = Field(index=True, max_length=16) # ssh for MVP action: str = Field(max_length=64) # exec:uptime|file:create|... - src_decky_uuid: Optional[str] = Field( - default=None, foreign_key="topology_deckies.uuid", index=True - ) - dst_decky_uuid: str = Field( - foreign_key="topology_deckies.uuid", index=True - ) + # No FK to topology_deckies: dst/src may be a TopologyDecky.uuid + # (MazeNET source), a "host_uuid:name" composite (fleet / SWARM shard + # sources), or — for retired deckies — a row that's already gone. The + # column is an opaque identifier matching whatever + # ``BaseRepository.list_running_deckies`` emits in its ``uuid`` field. + # Index is kept; the FK was misleading and broke fleet-source events. + src_decky_uuid: Optional[str] = Field(default=None, index=True) + dst_decky_uuid: str = Field(index=True) success: bool = Field(default=False, index=True) payload: str = Field( sa_column=Column("payload", Text, nullable=False, default="{}")