feat: data migration to retype doc notes to new NoteType values #230
No reviewers
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
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/pal-e-api!230
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "224-data-migration-retype-notes"
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?
Summary
Changes
alembic/versions/s9n0o1p2q3r4_data_migration_retype_notes.py: New data-only migration with 9 retype steps -- review (tag-based JOIN on note_tags/tags), architecture/validation/board (slug LIKE patterns), and 5 deprecated type consolidations. All steps idempotent via WHERE guards. Downgrade reverses slug/tag-based retypes (steps 1-4).tests/test_retype_migration.py: 9 tests covering each retype category, unrelated note preservation, already-migrated note safety, idempotency (double upgrade), and downgrade reversal.Test Plan
pytest tests/test_retype_migration.py -v-- 9/9 passpytest tests/ -v-- 668 pass, 12 fail (pre-existing failures in test_board_sync.py, confirmed identical on main)ruff formatandruff checkcleanalembic upgrade headagainst staging/prod database after mergeReview Checklist
Related Notes
pal-e-docs-- the project this work belongs toQA Review -- PR #230
Migration (
s9n0o1p2q3r4_data_migration_retype_notes.py)r8m9n0o1p2q3->s9n0o1p2q3r4note_tags/tagstables withnote_type = 'doc'guardnote_type = 'doc'guardNote: Steps 5-9 use f-string SQL (
f"...'{old_type}'..."). The values are hardcoded string constants, not user input, so no injection risk. Acceptable for Alembic data migrations.Tests (
test_retype_migration.py)importlib.utilapproach for loading migration module from file pathTest Results
test_board_sync.pyare pre-existing on main)Nits
None found.
VERDICT: APPROVE