From bb953e6857611e7b9c8b744500010b6a76eaa8d6 Mon Sep 17 00:00:00 2001 From: CREDO23 Date: Fri, 26 Jun 2026 12:12:13 +0200 Subject: [PATCH] refactor(db): shim notifications.search_space_id to physical workspace_id Phase 1 (rename DB) commit 1d: attribute->physical column shim on the notifications satellite model, plus the inbox-list index column-ref and its name aligned to workspace (ix_notifications_user_workspace_created). --- surfsense_backend/app/notifications/persistence/models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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,