notifications-fixes
All checks were successful
Deploy on push / deploy (push) Successful in 5m16s

This commit is contained in:
2025-10-04 08:36:24 +03:00
parent 6faf75c229
commit 163c0732d4
2 changed files with 24 additions and 2 deletions

View File

@@ -99,6 +99,23 @@ class NotificationSeen(Base):
)
class NotificationUnsubscribe(Base):
"""Модель для хранения отписок пользователей от уведомлений по определенным thread_id."""
__tablename__ = "notification_unsubscribe"
author_id: Mapped[int] = mapped_column(ForeignKey("author.id"), nullable=False)
thread_id: Mapped[str] = mapped_column(String, nullable=False)
created_at: Mapped[datetime] = mapped_column(DateTime, default=datetime.utcnow)
__table_args__ = (
PrimaryKeyConstraint(author_id, thread_id),
Index("idx_notification_unsubscribe_author", "author_id"),
Index("idx_notification_unsubscribe_thread", "thread_id"),
{"extend_existing": True},
)
class Notification(Base):
__tablename__ = "notification"