honcho/tests/alembic/revisions
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
..
__init__.py feat(migrations): add tenant_id primitive migration (OSS prosumer-safe) 2026-09-03 11:54:56 -04:00
test_7c0d9a4e3b1f_add_unique_index_for_pending_dreams.py Turbopuffer and LanceDB Integration (#287) 2026-01-16 17:04:01 -05:00
test_20f89a421aff_rename_metamessage_type_to_label.py Standardize DB Constraint Conventions (#272) 2025-11-20 11:50:54 -05:00
test_29ade7350c19_remove_document_level_valid_constraint.py rm: level_valid constraint (#266) 2025-11-17 12:56:37 -05:00
test_66e63cf2cf77_add_indexes_to_documents_table.py feat: introduce alembic migration verification (#238) 2025-10-23 16:24:35 -04:00
test_066e87ca5b07_align_schema_with_declarative_models.py align DB state to sqlalchemy model definitions (#245) 2025-11-03 14:58:12 -05:00
test_76ffba56fe8c_add_error_field_to_queueitem.py feat: introduce alembic migration verification (#238) 2025-10-23 16:24:35 -04:00
test_88b0fb10906f_add_webhooks_table.py feat: introduce alembic migration verification (#238) 2025-10-23 16:24:35 -04:00
test_110bdf470272_rename_deriver_disabled_to_deriver_.py API/SDK updates: configurability, more parameters. Unified test harness (#283) 2025-12-03 16:49:30 -05:00
test_119a52b73c60_support_external_embeddings.py Turbopuffer and LanceDB Integration (#287) 2026-01-16 17:04:01 -05:00
test_556a16564f50_add_user_id_and_app_id_to_tables.py feat: introduce alembic migration verification (#238) 2025-10-23 16:24:35 -04:00
test_564ba40505c5_add_session_name_column_to_documents.py feat: introduce alembic migration verification (#238) 2025-10-23 16:24:35 -04:00
test_05486ce795d5_make_session_name_required_on_messages.py feat: introduce alembic migration verification (#238) 2025-10-23 16:24:35 -04:00
test_917195d9b5e9_add_messageembedding_table.py feat: introduce alembic migration verification (#238) 2025-10-23 16:24:35 -04:00
test_08894082221a_replace_collection_name_with_observer_.py fix: Ensure alembic migrations use a session pooler (#247) 2025-10-28 17:41:49 -04:00
test_a1b2c3d4e5f6_initial_schema.py feat: introduce alembic migration verification (#238) 2025-10-23 16:24:35 -04:00
test_b765d82110bd_change_metamessages_to_user_level_with_.py feat: introduce alembic migration verification (#238) 2025-10-23 16:24:35 -04:00
test_b8183c5ffb48_codify_document_level_and_times_derived.py feat: codify queue columns (#254) 2025-11-07 13:22:24 -05:00
test_baa22cad81e2_standardize_constraint_names.py Standardize DB Constraint Conventions (#272) 2025-11-20 11:50:54 -05:00
test_bb6fb3a7a643_add_message_seq_in_session_column.py fix: add test for message seq in session (#268) 2025-11-17 12:54:23 -05:00
test_c3828084f472_add_indexes_for_messages_and_.py feat: introduce alembic migration verification (#238) 2025-10-23 16:24:35 -04:00
test_d429de0e5338_adopt_peer_paradigm.py feat: introduce alembic migration verification (#238) 2025-10-23 16:24:35 -04:00
test_e4eba9cfaa6f_make_document_session_name_nullable.py feat: make session_name nullable for documents and update related SDKs (#347) 2026-01-26 13:33:11 -05:00
test_e5fe7f8bcf62_add_tenant_id_primitive.py feat(migrations): add tenant_id primitive migration (OSS prosumer-safe) 2026-09-03 11:54:56 -04:00
test_e9b705f9adf9_add_server_defaults_to_timestamp_.py align DB state to sqlalchemy model definitions (#245) 2025-11-03 14:58:12 -05:00
test_ec8f94139b02_codify_workspace_name_and_message_id_in_.py feat: codify queue columns (#254) 2025-11-07 13:22:24 -05:00
test_f1a2b3c4d5e6_add_reasoning_tree_columns.py feat: agentic dreamer and agentic dialectic (#309) 2026-01-12 15:12:17 -05:00