feat: add conversation_type and briefing_date to Conversation model

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-11 19:45:47 -04:00
parent 598901b9a2
commit fa81509c9f
2 changed files with 30 additions and 1 deletions
+10 -1
View File
@@ -1,4 +1,6 @@
from sqlalchemy import ForeignKey, Index, Integer, Text
import datetime
from sqlalchemy import Date, ForeignKey, Index, Integer, Text
from sqlalchemy import inspect
from sqlalchemy.dialects.postgresql import JSONB
from sqlalchemy.orm import Mapped, mapped_column, relationship
@@ -16,6 +18,11 @@ class Conversation(Base, TimestampMixin):
)
title: Mapped[str] = mapped_column(Text, default="")
model: Mapped[str] = mapped_column(Text, default="")
# 'chat' (default) or 'briefing'. Briefing conversations are hidden from
# the main chat view and managed by the briefing pipeline.
conversation_type: Mapped[str] = mapped_column(Text, default="chat", server_default="chat")
# For briefing conversations only: the calendar date this briefing covers.
briefing_date: Mapped[datetime.date | None] = mapped_column(Date, nullable=True)
messages: Mapped[list["Message"]] = relationship(
back_populates="conversation",
@@ -38,6 +45,8 @@ class Conversation(Base, TimestampMixin):
"id": self.id,
"title": self.title,
"model": self.model,
"conversation_type": self.conversation_type,
"briefing_date": self.briefing_date.isoformat() if self.briefing_date else None,
"message_count": msg_count,
"created_at": self.created_at.isoformat(),
"updated_at": self.updated_at.isoformat(),