diff --git a/surfsense_backend/app/notifications/persistence/models.py b/surfsense_backend/app/notifications/persistence/models.py index 557c4bf17..e0d3d8dfc 100644 --- a/surfsense_backend/app/notifications/persistence/models.py +++ b/surfsense_backend/app/notifications/persistence/models.py @@ -34,9 +34,9 @@ class Notification(BaseModel, TimestampMixin): ), # Serves the paginated inbox list query. Index( - "ix_notifications_user_space_created", + "ix_notifications_user_workspace_created", "user_id", - "search_space_id", + "workspace_id", "created_at", ), ) @@ -48,6 +48,7 @@ class Notification(BaseModel, TimestampMixin): index=True, ) search_space_id = Column( + "workspace_id", Integer, ForeignKey("searchspaces.id", ondelete="CASCADE"), nullable=True,