feat(chats): add per-user pinned chats and pinned sorting

This commit is contained in:
2026-03-08 09:54:43 +03:00
parent fdf973eeab
commit 8cdcd9531d
9 changed files with 139 additions and 4 deletions

View File

@@ -85,6 +85,8 @@ class ChatUserSetting(Base):
chat_id: Mapped[int] = mapped_column(ForeignKey("chats.id", ondelete="CASCADE"), nullable=False, index=True)
user_id: Mapped[int] = mapped_column(ForeignKey("users.id", ondelete="CASCADE"), nullable=False, index=True)
archived: Mapped[bool] = mapped_column(Boolean, nullable=False, default=False, server_default="false")
pinned: Mapped[bool] = mapped_column(Boolean, nullable=False, default=False, server_default="false")
pinned_at: Mapped[datetime | None] = mapped_column(DateTime(timezone=True), nullable=True)
updated_at: Mapped[datetime] = mapped_column(
DateTime(timezone=True),
server_default=func.now(),