fix: add folder_id and sort_order to AIChatSession model, fix UUID conversion in routes, add migration 0003

This commit is contained in:
Agent Zero
2026-07-17 21:20:49 +02:00
parent 165350eda0
commit 3fc4dcdb96
5 changed files with 38 additions and 3 deletions
@@ -149,6 +149,12 @@ class AIChatSession(Base, TenantMixin):
title: Mapped[str] = mapped_column(String(255), nullable=False, default="Neuer Chat")
is_pinned: Mapped[bool] = mapped_column(Boolean, nullable=False, default=False)
is_sidebar: Mapped[bool] = mapped_column(Boolean, nullable=False, default=False)
folder_id: Mapped[uuid.UUID | None] = mapped_column(
PGUUID(as_uuid=True),
ForeignKey("ai_chat_folders.id", ondelete="SET NULL"),
nullable=True,
)
sort_order: Mapped[int] = mapped_column(Integer, nullable=False, default=0)
# --- Chat Messages ---
@@ -200,6 +206,7 @@ class AIChatFolder(Base, TenantMixin):
nullable=True,
)
user_id: Mapped[uuid.UUID] = mapped_column(PGUUID(as_uuid=True), nullable=False)
sort_order: Mapped[int] = mapped_column(Integer, nullable=False, default=0)
# --- Chat Attachments ---