refactor(db): rename searchspaces table to workspaces

Phase 1 (rename DB) commit 1i: rename the SearchSpace table to workspaces
and flip all 24 inbound FK target strings (20 in db.py + the 4 satellite
models), plus the raw-SQL searchspaces references in the obsidian and
google-unification integration fixtures.

This completes the ORM half of Phase 1. The SearchSpace class name,
relationship/back_populates attribute names, and the /searchspaces API
route URLs are intentionally left for Phase 2.

Verified: unit 2375 passed/1 skip, integration 346 passed (baseline
parity); create_all builds every table with the workspaces name and all
FKs resolving to workspaces.id.
This commit is contained in:
CREDO23 2026-06-26 13:27:16 +02:00
parent 35f80268df
commit c6d4e5df7c
7 changed files with 28 additions and 28 deletions

View file

@ -199,7 +199,7 @@ async def committed_google_data(async_engine):
async with async_engine.begin() as conn:
await conn.execute(
text("DELETE FROM searchspaces WHERE id = :sid"), {"sid": space_id}
text("DELETE FROM workspaces WHERE id = :sid"), {"sid": space_id}
)
@ -306,5 +306,5 @@ async def cleanup_space(async_engine, space_id: int):
"""Delete a search space (cascades to connectors/documents)."""
async with async_engine.begin() as conn:
await conn.execute(
text("DELETE FROM searchspaces WHERE id = :sid"), {"sid": space_id}
text("DELETE FROM workspaces WHERE id = :sid"), {"sid": space_id}
)