refactor(roster)!: rename UnitInquiry to UnitPetition - #561
Merged
Conversation
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
…etition-rename-uimol1
#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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
honestly can't remember how we ended up with two names but we should have just one