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.
This commit is contained in:
CREDO23 2026-06-26 12:29:29 +02:00
parent 581ae693fc
commit 3b545540e9

View file

@ -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)