SurfSense/surfsense_backend/alembic
CREDO23 5090ed734d feat(db): rename searchspace schema to workspace (migration 170)
Phase 1 (rename DB) commit 3: single Alembic migration (down_revision=169)
that physically renames the SearchSpace schema to WorkSpace to match the
already-shimmed ORM. Renames 4 tables, 24 columns
(search_space_id->workspace_id, owner_search_space_id->owner_workspace_id),
37 named/auto FK/PK/unique constraints, 25 indexes, and 4 sequences. Guarded
forms (ALTER ... IF EXISTS / DO-block RENAME CONSTRAINT) tolerate
runtime-created and absent objects.

Zero publication is reconciled via the blessed path: neutralize the four
column-list tables (documents/automations/new_chat_threads/podcasts) from the
publication, rename, then apply_publication() re-emits SET TABLE with the new
workspace_id lists (no raw DROP/CREATE PUBLICATION, per migration 116).
Downgrade fully reverses the renames and restores the old search_space_id
publication shape via a hardcoded SET TABLE, never importing the live module.

Targets the existing-deployment upgrade path (169 -> 170). The from-scratch
alembic path is a separate, pre-existing concern (0_initial uses create_all).

Verified on a realistic legacy@169 DB (with publication): upgrade clean,
zero_publication --verify passes, autogenerate EMPTY on a create_all DB,
and upgrade->downgrade->upgrade round-trips (old shape + old publication
restored on downgrade). Single alembic head = 170.
2026-06-26 17:27:31 +02:00
..
versions feat(db): rename searchspace schema to workspace (migration 170) 2026-06-26 17:27:31 +02:00
env.py feat(docker): add ZERO_AUTO_RESET configuration for improved replication safety 2026-06-06 14:21:14 +05:30
README add github connector, add alembic for db migrations, fix bug updating connectors 2025-04-13 13:56:22 -07:00
script.py.mako add github connector, add alembic for db migrations, fix bug updating connectors 2025-04-13 13:56:22 -07:00

Generic single-database configuration with an async dbapi.