Add board_note_id FK to board_items + data migration #196
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#196
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
Feature
Lineage
Standalone — board-pal-e-docs kanban unification. Depends on: "Add board to NoteType"
Repo
forgejo_admin/pal-e-docsUser Story
As the platform owner
I want board items to reference notes instead of the boards table
So that any note (phase, ticket, project page) can have a kanban board attached to it
Context
This is the core migration. Currently board_items.board_id FK → boards.id. After this: board_items.board_note_id FK → notes.id (where note_type="board"). The boards table remains temporarily (dual-write) until downstream consumers are updated.
Steps:
File Targets
Files to modify:
src/pal_e_docs/models.py— add board_note_id column to BoardItem, add relationshipalembic/versions/— new migration adding column + FKscripts/— data migration script to create board notes and backfillFiles NOT to touch:
src/pal_e_docs/routes/boards.py— API changes are a separate ticketAcceptance Criteria
Test Expectations
pytest tests/test_boards.py -vConstraints
Checklist
Related
project-pal-e-docs— core migration for kanban unificationScope Review: NEEDS_REFINEMENT
Review note:
review-315-2026-03-24Two fixable issues found — ticket is well-structured but has inaccurate data and a missing detail.
scripts/but doesn't specify the migration script name. Suggestscripts/migrate_boards_to_notes.pyfor agent clarity.Review Refinements (from review-315-2026-03-24)
Fix 1: Test Expectations — corrected board count. There are 13 boards total, not 6. The data migration must create notes for all 13.
Fix 2: File Targets — added explicit script filename:
scripts/migrate_boards_to_notes.pyUpdated Test Expectations
pytest tests/test_boards.py -vUpdated File Targets addition
scripts/migrate_boards_to_notes.py— creates board notes + backfills board_note_idScope Review: READY
Review note:
review-315-2026-03-24(updated)Re-review after NEEDS_REFINEMENT — both refinements verified and confirmed.
scripts/migrate_boards_to_notes.pyexplicitly specified in comment #6581.