Set explicit primaryjoin for AI generation run -> items relationship

This commit is contained in:
dwindown
2026-04-28 18:54:42 +07:00
parent 7626e6f2e0
commit 3151b27c27

View File

@@ -68,6 +68,7 @@ class AIGenerationRun(Base):
generated_items: Mapped[list["Item"]] = relationship( generated_items: Mapped[list["Item"]] = relationship(
"Item", "Item",
back_populates="generation_run", back_populates="generation_run",
primaryjoin="AIGenerationRun.id == Item.generation_run_id",
foreign_keys="Item.generation_run_id", foreign_keys="Item.generation_run_id",
lazy="selectin", lazy="selectin",
) )