added memmory
This commit is contained in:
@@ -93,6 +93,48 @@ class ProjectBinding(Base):
|
||||
)
|
||||
|
||||
|
||||
class UserProfile(Base):
|
||||
__tablename__ = "user_profile"
|
||||
|
||||
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
|
||||
data_json: Mapped[str] = mapped_column(Text, default="{}")
|
||||
updated_at: Mapped[datetime] = mapped_column(
|
||||
DateTime(timezone=True), server_default=func.now(), onupdate=func.now()
|
||||
)
|
||||
|
||||
|
||||
class MemoryFact(Base):
|
||||
__tablename__ = "memory_facts"
|
||||
|
||||
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
|
||||
category: Mapped[str] = mapped_column(String(64), default="fact", index=True)
|
||||
content: Mapped[str] = mapped_column(Text)
|
||||
source: Mapped[str] = mapped_column(String(32), default="user")
|
||||
session_id: Mapped[int | None] = mapped_column(
|
||||
ForeignKey("chat_sessions.id", ondelete="SET NULL"), nullable=True, index=True
|
||||
)
|
||||
importance: Mapped[int] = mapped_column(Integer, default=3)
|
||||
active: Mapped[bool] = mapped_column(Boolean, default=True, index=True)
|
||||
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now())
|
||||
updated_at: Mapped[datetime] = mapped_column(
|
||||
DateTime(timezone=True), server_default=func.now(), onupdate=func.now()
|
||||
)
|
||||
|
||||
|
||||
class SessionSummary(Base):
|
||||
__tablename__ = "session_summaries"
|
||||
|
||||
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
|
||||
session_id: Mapped[int] = mapped_column(
|
||||
ForeignKey("chat_sessions.id", ondelete="CASCADE"), unique=True, index=True
|
||||
)
|
||||
summary: Mapped[str] = mapped_column(Text, default="")
|
||||
message_count: Mapped[int] = mapped_column(Integer, default=0)
|
||||
updated_at: Mapped[datetime] = mapped_column(
|
||||
DateTime(timezone=True), server_default=func.now(), onupdate=func.now()
|
||||
)
|
||||
|
||||
|
||||
class WorkItem(Base):
|
||||
__tablename__ = "work_items"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user