Fix ambiguous SQLAlchemy join for AI generation run relationships

This commit is contained in:
dwindown
2026-04-28 18:53:26 +07:00
parent f91c54f197
commit 7626e6f2e0
2 changed files with 2 additions and 0 deletions

View File

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

View File

@@ -223,6 +223,7 @@ class Item(Base):
generation_run: Mapped[Union["AIGenerationRun", None]] = relationship(
"AIGenerationRun",
back_populates="generated_items",
foreign_keys=[generation_run_id],
lazy="selectin",
)