Skip to content

refactor(roster)!: rename UnitInquiry to UnitPetition - #561

Merged
vEnhance merged 3 commits into
mainfrom
claude/unit-inquiry-petition-rename-uimol1
Aug 25, 2026
Merged

refactor(roster)!: rename UnitInquiry to UnitPetition#561
vEnhance merged 3 commits into
mainfrom
claude/unit-inquiry-petition-rename-uimol1

Conversation

@vEnhance

Copy link
Copy Markdown
Owner

honestly can't remember how we ended up with two names but we should have just one

claude added 3 commits August 25, 2026 14:38
The user-facing name has always been "unit petition"; only the internals
said "inquiry". This aligns them.

The schema change is a RenameModel (ALTER TABLE ... RENAME), so every row
is carried over in place. Note that makemigrations autodetects this as a
CreateModel/DeleteModel pair instead, which would drop the table and every
petition in it -- hence the hand-written 0119.

The stored INQ_* choice values become PET_* in 0120, a RunPython over an
explicit old <-> new mapping. It only issues UPDATEs, never creates or
deletes rows, and leaves any value outside the mapping alone rather than
coercing it to a default. Both directions were exercised against a real
database: rows migrate backwards to the pre-rename state and forwards
again byte-identical, primary keys included.

core.UserProfile.email_on_inquiry_complete becomes
email_on_petition_complete via RenameField, which is likewise in-place.

Renamed throughout: the form, views, URL names, template, factory, admin
and local variables. The old /roster/inquiry/<pk>/ URL now redirects to
the new one so student bookmarks keep working.

BREAKING CHANGE: The Aincrad API changes with it, as agreed. The
"accept_inquiries" action is now "accept_petitions", and the init
payload's "inquiries" key and its "unlock_inquiry_count" field are now
"petitions" and "unlock_petition_count". The consumer needs updating.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012tmVNTck2f5p5pJez64MmT
#560 landed its own core migration numbered 0072, so both branches had a
0072 depending on 0071 and the graph had two leaf nodes. Renumbered ours
to 0073 and pointed it at theirs, rather than adding a merge migration.
The two RenameFields touch different models (Semester vs UserProfile), so
linearizing them is order-independent.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012tmVNTck2f5p5pJez64MmT
@vEnhance
vEnhance merged commit 573b021 into main Aug 25, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants