feat(briefing): add Message.msg_metadata and RssItem.topics/classified_at columns
msg_metadata maps to the 'metadata' DB column ('metadata' is reserved
by SQLAlchemy Declarative API). to_dict() exposes the key as 'metadata'
for frontend compatibility.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -67,6 +67,9 @@ class Message(Base, CreatedAtMixin):
|
||||
Integer, ForeignKey("notes.id", ondelete="SET NULL"), nullable=True
|
||||
)
|
||||
tool_calls: Mapped[list | None] = mapped_column(JSONB, nullable=True)
|
||||
# 'metadata' is reserved by SQLAlchemy Declarative — use msg_metadata as the
|
||||
# Python attribute name, mapped to the 'metadata' DB column.
|
||||
msg_metadata: Mapped[dict | None] = mapped_column("metadata", JSONB, nullable=True)
|
||||
|
||||
conversation: Mapped["Conversation"] = relationship(back_populates="messages")
|
||||
|
||||
@@ -83,5 +86,6 @@ class Message(Base, CreatedAtMixin):
|
||||
"status": self.status,
|
||||
"context_note_id": self.context_note_id,
|
||||
"tool_calls": self.tool_calls,
|
||||
"metadata": self.msg_metadata,
|
||||
"created_at": self.created_at.isoformat(),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user