From 0ed043379d77bc817f34a18f6e0f8bd4ede3f13c Mon Sep 17 00:00:00 2001 From: CREDO23 Date: Fri, 26 Jun 2026 12:30:38 +0200 Subject: [PATCH] refactor(db): rename search_space_memberships table to workspace_memberships Phase 1 (rename DB) commit 1g: rename the memberships table (no inbound FKs reference it) and update the matching raw-SQL cleanup in the obsidian plugin test. Relationship attribute names stay until Phase 2. --- surfsense_backend/app/db.py | 2 +- .../tests/integration/test_obsidian_plugin_routes.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/surfsense_backend/app/db.py b/surfsense_backend/app/db.py index fff5c4d3a..3a5843cd4 100644 --- a/surfsense_backend/app/db.py +++ b/surfsense_backend/app/db.py @@ -2102,7 +2102,7 @@ class SearchSpaceMembership(BaseModel, TimestampMixin): Each user can be a member of multiple search spaces with different roles. """ - __tablename__ = "search_space_memberships" + __tablename__ = "workspace_memberships" __table_args__ = ( UniqueConstraint( "user_id", diff --git a/surfsense_backend/tests/integration/test_obsidian_plugin_routes.py b/surfsense_backend/tests/integration/test_obsidian_plugin_routes.py index 0d874452a..1528f1d7b 100644 --- a/surfsense_backend/tests/integration/test_obsidian_plugin_routes.py +++ b/surfsense_backend/tests/integration/test_obsidian_plugin_routes.py @@ -125,7 +125,7 @@ async def race_user_and_space(async_engine): {"uid": user_id}, ) await cleanup.execute( - text("DELETE FROM search_space_memberships WHERE workspace_id = :id"), + text("DELETE FROM workspace_memberships WHERE workspace_id = :id"), {"id": space_id}, ) await cleanup.execute(