sync update from LAN repo (source dhk-1 @ 3e87be55)
This commit is contained in:
1 parent
ab6068a7c1
commit
42f2a26fa8
1482 files changed
+227759
-9584
No files matched your search
+18
-3
@@ -16,12 +16,27 @@ class ThreadMetaRow(Base):
|
||||
__table_args__ = (
|
||||
Index("ix_threads_meta_created_user", "created_at", "user_id"),
|
||||
Index("ix_threads_meta_user_created", "user_id", "created_at"),
|
||||
# Task deep-link history is globally shared and therefore cannot use
|
||||
# the normal ``user_id`` scope. Keep its high-cardinality lookup
|
||||
# fields out of ``metadata_json`` so task entry never has to scan and
|
||||
# Python-filter every thread in the installation.
|
||||
Index("ix_threads_meta_task_agent_updated", "task_id", "agent_id", "updated_at", "thread_id"),
|
||||
Index("ix_threads_meta_task_action_agent_updated", "task_id", "action_id", "agent_id", "updated_at", "thread_id"),
|
||||
# The ordinary recent-chat path has an owner filter and the same
|
||||
# updated-at ordering. This prevents a full table sort there too.
|
||||
Index("ix_threads_meta_user_updated", "user_id", "updated_at", "thread_id"),
|
||||
)
|
||||
|
||||
thread_id: Mapped[str] = mapped_column(String(64), primary_key=True)
|
||||
assistant_id: Mapped[str | None] = mapped_column(String(128), index=True)
|
||||
user_id: Mapped[str | None] = mapped_column(String(64), index=True)
|
||||
display_name: Mapped[str | None] = mapped_column(String(256))
|
||||
assistant_id: Mapped[str | None] = mapped_column(String(128), index=True)
|
||||
user_id: Mapped[str | None] = mapped_column(String(64), index=True)
|
||||
# Indexed projections of the corresponding metadata values. The JSON
|
||||
# blob remains authoritative and supports arbitrary metadata filters;
|
||||
# these columns exist solely for the task-workspace hot path.
|
||||
task_id: Mapped[str | None] = mapped_column(String(128), nullable=True)
|
||||
agent_id: Mapped[str | None] = mapped_column(String(128), nullable=True)
|
||||
action_id: Mapped[str | None] = mapped_column(String(128), nullable=True)
|
||||
display_name: Mapped[str | None] = mapped_column(String(256))
|
||||
status: Mapped[str] = mapped_column(String(20), default="idle")
|
||||
metadata_json: Mapped[dict] = mapped_column(PortableJSON(), default=dict)
|
||||
created_at: Mapped[datetime] = mapped_column(BeijingDateTime(), default=lambda: datetime.now(UTC))
|
||||
|
||||
Reference in new issue
Block a user