fix: add partial index declarations to models for alembic check #265
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ldraney/pal-e-api#265
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type
bug
Lineage
Standalone fix — CI pipeline #93 failure
Repo
forgejo_admin/pal-e-api
User Story
As a developer, I need alembic check to pass in CI so that the migration-test pipeline step does not block merges.
What Broke
Pipeline #93 fails at migration-test because
alembic checkdetects two partial indexes in the DB (created by migration u1p2q3r4s5t6) that are NOT declared in the SQLAlchemy models. The autogenerate comparison flags them as "should be removed."Repro Steps
alembic checkagainst the current modelsix_blocks_block_type_mermaidandix_notes_note_type_architectureas needing removalExpected Behavior
alembic checkshould pass cleanly — no detected differences between models and DB.Environment
CI pipeline (Woodpecker), pal-e-api main branch
Context
The fix is model-only — no new migration needed since indexes already exist in DB.
File Targets
src/pal_e_docs/models.py— add Index declarations to Block and Note modelsAcceptance Criteria
alembic checkpasses without detecting phantom index removals__table_args__includesix_blocks_block_type_mermaidpartial index__table_args__withix_notes_note_type_architecturepartial indextextimported from sqlalchemyTest Expectations
python -c "from pal_e_docs.models import Block, Note; print('OK')"imports cleanlyruff checkandruff formatpassalembic checkno longer flags missing indexesConstraints
Checklist
textto sqlalchemy imports__table_args____table_args__with architecture partial index to Note modelRelated