Fix CalendarEntryPost join: add explicit ON clause for polymorphic content_id
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m47s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m47s
content_id is a loose reference (no FK to posts.id), so SQLAlchemy cannot infer the join condition automatically. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -97,7 +97,7 @@ async def get_entry_posts(
|
|||||||
"""
|
"""
|
||||||
result = await session.execute(
|
result = await session.execute(
|
||||||
select(Post)
|
select(Post)
|
||||||
.join(CalendarEntryPost)
|
.join(CalendarEntryPost, (CalendarEntryPost.content_id == Post.id) & (CalendarEntryPost.content_type == "post"))
|
||||||
.where(
|
.where(
|
||||||
CalendarEntryPost.entry_id == entry_id,
|
CalendarEntryPost.entry_id == entry_id,
|
||||||
CalendarEntryPost.deleted_at.is_(None)
|
CalendarEntryPost.deleted_at.is_(None)
|
||||||
|
|||||||
Reference in New Issue
Block a user