From 3b545540e9dedf341e8312cc3bee281d291a828e Mon Sep 17 00:00:00 2001 From: CREDO23 Date: Fri, 26 Jun 2026 12:29:29 +0200 Subject: [PATCH] refactor(db): rename search_space_invites table to workspace_invites Phase 1 (rename DB) commit 1f: rename the invites table and flip the one inbound FK (memberships.invited_by_invite_id). The invites row's own role_id -> search_space_roles FK is left for the roles rename commit. --- surfsense_backend/app/db.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/surfsense_backend/app/db.py b/surfsense_backend/app/db.py index 163bce912..fff5c4d3a 100644 --- a/surfsense_backend/app/db.py +++ b/surfsense_backend/app/db.py @@ -2136,7 +2136,7 @@ class SearchSpaceMembership(BaseModel, TimestampMixin): # Reference to the invite used to join (null if owner/creator) invited_by_invite_id = Column( Integer, - ForeignKey("search_space_invites.id", ondelete="SET NULL"), + ForeignKey("workspace_invites.id", ondelete="SET NULL"), nullable=True, ) @@ -2154,7 +2154,7 @@ class SearchSpaceInvite(BaseModel, TimestampMixin): Users can create invite links with specific roles that others can use to join. """ - __tablename__ = "search_space_invites" + __tablename__ = "workspace_invites" # Unique invite code (used in invite URLs) invite_code = Column(String(64), nullable=False, unique=True, index=True)