honcho/migrations
Phil 418e59ca2e feat(migrations): add tenant_id primitive migration (OSS prosumer-safe)
Add the alembic migration that makes tenant_id a first-class primitive: a new
tenants table + tenant_id with composite PKs / uniques / FKs / indexes on every
tenant-scoped table, matching the declarative models MINUS physical partitioning.
Self-host/prosumer safe: transforms the existing single-tenant schema in place and
backfills every row to a default tenant. A top-of-upgrade guard (tenants-exists)
makes it a no-op on the shared/prod schema, which the internal bootstrap builds and
alembic-stamps past.

Rename tenants.legacy_app_name -> vector_correlation_id (impl-agnostic: the durable
external vector-store namespace key, not legacy).

Remove scripts/bootstrap_shared_schema.py + its test from OSS -- the prod-only
shared-schema standup moves to the internal migration runbook. Strip internal /
migration-transient comments from models.py per the OSS-safe pass.

Verified: pytest tests/alembic -k e5fe7f8bcf62 passes on the full revision chain.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-09-03 11:54:56 -04:00
..
versions feat(migrations): add tenant_id primitive migration (OSS prosumer-safe) 2026-09-03 11:54:56 -04:00
README Add Pre-commit Hooks (#165) 2025-07-22 15:17:53 -04:00
env.py Standardize DB Constraint Conventions (#272) 2025-11-20 11:50:54 -05:00
script.py.mako align DB state to sqlalchemy model definitions (#245) 2025-11-03 14:58:12 -05:00
utils.py Standardize DB Constraint Conventions (#272) 2025-11-20 11:50:54 -05:00

README

Generic single-database configuration.