This commit is contained in:
@@ -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"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user