fix(migrations): add missing migration for SpecifyUser.spprincipals#8237
Open
grantfitzsimmons wants to merge 2 commits into
Open
fix(migrations): add missing migration for SpecifyUser.spprincipals#8237grantfitzsimmons wants to merge 2 commits into
SpecifyUser.spprincipals#8237grantfitzsimmons wants to merge 2 commits into
Conversation
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA new Django migration ( Migration 0045
🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Fixes #8236
Warning
This PR affects database migrations. See migration testing instructions.
This PR introduces migration
0045_specifyuser_spprincipals_alter.pyto resolve an unapplied model discrepancy warning in the logs during startup.The discrepancy was caused by an omission in previous commits where the metadata configuration of the
spprincipalsfield on theSpecifyUsermodel was changed to explicitly userelated_name='specifyusers'.Because this is a schema-metadata change on a
ManyToManyFieldwith an intermediate table (through='specify.Specifyuser_spprincipal'), Django automatically handles the reverse relationship mapping. Running this migration registers the change indjango_migrationsand silences the logs without altering physical database tables/columns.Checklist
self-explanatory (or properly documented)
specify7/specifyweb/specify/management/commands/run_key_migration_functions.py
Line 50 in ea04665
(Note: "Add migration function..." is unchecked because this is a standard, automatic Django schema metadata update rather than a custom data manipulation/key migration function).
Testing instructions
This will be easiest done by developers in a local environment:
Rollback Verification:
Verify that the reverse migration is supported and executes cleanly:
This should revert back to migration
0044without errors. Runpython manage.py migrate specifyagain to re-apply the fix.Summary by CodeRabbit