Skip to content

Commit 98b0f39

Browse files
earayuclaude
andauthored
cleanup(phase7): regenerate migrations to post-phase-7 initial (#1666)
* cleanup(phase7): regenerate migrations to post-phase-7 initial Replace the 32-revision Alembic chain with a single post-Phase-7 initial migration. Fresh empty DB → `alembic upgrade head` now yields the exact same schema as the current ORM state, with no intermediate LightRAG / legacy steps. Ghost-check: - docs/modularization/cleanup-inventory.md §Phase7-postmerge: chain collapsed, zero schema change - §1 Layer A / B / C untouched: aperag/db/base.py Base.metadata unchanged; aperag/db/models.py Invitation class-body `Role` binding via `from aperag.domains.identity.db.models import ... Role ...` preserved; env.py per-domain model imports preserved - G17 / G18-alt CRITICAL_WIRINGS unchanged (migration layer doesn't touch DI); 20/20 G1-G19 boundary tests pass Verification: - Old chain: 32 revisions (base db9c88848f52 → head e1f2a3b4c5d6) - New chain: 1 revision (base → head 6a8fc31427d9 `post_phase_7_initial`) - Round-trip: `alembic downgrade base` + `alembic upgrade head` succeed against fresh local Postgres 16 + pgvector 0.7.2 DB; 41 relations created (40 ORM tables + alembic_version) - Stability: second `alembic revision --autogenerate` produces an empty upgrade() / downgrade() (no drift) - Tables: all 13 domain surfaces present (identity / governance / model_platform / marketplace / knowledge_base / indexing / retrieval / knowledge_graph / conversation / agent_runtime / evaluation) plus 11 legacy local ORMs (ConfigModel / UserQuota / Invitation / PromptTemplate / Setting / ExportTask / Evaluation / EvaluationItem / Question / QuestionSet / ModelServiceProvider) - No pgvector extension / Vector column DDL in the initial: no ORM declares Vector type post-Phase-7 (LightRAG tables already dropped) - No re-export shim leakage; invitation.role renders as String(50) (EnumColumn helper is a varchar, matching identity domain Role) Tests: - tests/unit_test/test_modularization_boundaries.py: 20 passed - tests/unit_test/ broad regression (minus pre-existing unrelated failure `test_phase1_fe_complete_identity_auth_admin_audit_adapter_boundary`): 577 passed, 29 skipped Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * cleanup(phase7): strip trailing whitespace on new initial migration Weston blocker-level CR (msg=fa0b6b4e) found 1 mechanical `git diff --check` blocker: `aperag/migration/versions/20260425041904-6a8fc31427d9.py:4` had trailing whitespace on the `Revises: ` line (template artifact from alembic autogenerate). Normalized via `rstrip()` on all lines. Whitespace-only change; no logic or schema diff. Ghost-check: none — §1 Layer A/B/C/D/E untouched; whitespace-only trailing-space strip. --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 613514c commit 98b0f39

33 files changed

Lines changed: 865 additions & 2730 deletions

aperag/migration/versions/20250729184152-db9c88848f52.py

Lines changed: 0 additions & 33 deletions
This file was deleted.

aperag/migration/versions/20250729184154-1c554c77c8e5.py

Lines changed: 0 additions & 546 deletions
This file was deleted.

aperag/migration/versions/20250729184156-b598e645b2ba.py

Lines changed: 0 additions & 33 deletions
This file was deleted.

aperag/migration/versions/20250730110318-f7671d2a7bff.py

Lines changed: 0 additions & 39 deletions
This file was deleted.

aperag/migration/versions/20250801165924-69b1deed0316.py

Lines changed: 0 additions & 65 deletions
This file was deleted.

aperag/migration/versions/20250805104914-5b7f5b4b3765.py

Lines changed: 0 additions & 36 deletions
This file was deleted.

aperag/migration/versions/20250806163353-f53af2d39508.py

Lines changed: 0 additions & 53 deletions
This file was deleted.

aperag/migration/versions/20250817183626-413ebe1ef0d5.py

Lines changed: 0 additions & 100 deletions
This file was deleted.

0 commit comments

Comments
 (0)