Correct creation of and deduplicate SpAppResourceDirs#7993
Merged
grantfitzsimmons merged 2 commits intov7_12_0_4from Apr 18, 2026
Merged
Correct creation of and deduplicate SpAppResourceDirs#7993grantfitzsimmons merged 2 commits intov7_12_0_4from
grantfitzsimmons merged 2 commits intov7_12_0_4from
Conversation
grantfitzsimmons
approved these changes
Apr 17, 2026
Member
grantfitzsimmons
left a comment
There was a problem hiding this comment.
- Use a database that has migrations ran from any version of
v7.12.0.0-v7.12.0.3(and thus will have duplicated SpAppResourceDirs) - Execute the
run_key_migration_functionsand ensure the duplicate SpAppResourceDir records get deleted - Use a database that does not have migrations from any version of
v7.12.0ran on it - Ensure that there are no duplicated SpAppResourceDir records, and if any were created that they have a "correct" DisciplineType (the name of the Discipline they're assigned to)
👍 Tested on a local copy of the paris DB (with 7.12) and a copy of KU Vert Paleo (never used with 7.12)
acwhite211
approved these changes
Apr 17, 2026
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 part of #7984
Companion of #7990
Checklist
self-explanatory (or properly documented)
specify7/specifyweb/specify/management/commands/run_key_migration_functions.py
Line 50 in ea04665
Testing instructions
If needed, you can use the following Query to identity SpAppResourceDirs and any AppResources within those "directories":
You can also use the following query to idenity SpAppResourceDirs and any View Sets within those "directories":
For the Issue when looking for duplicates, you will be looking for SpAppResourceDir records that have a new Timestamp Created and have the following attributes (which should appear in earlier SpAppResourceDir records if they previously existed):
a non-NULL DisciplineID
NULL CollectionID
NULL UserType
False IsPersonal
Use a database that has migrations ran from any version of
v7.12.0.0-v7.12.0.3(and thus will have duplicated SpAppResourceDirs)Execute the
run_key_migration_functionsand ensure the duplicate SpAppResourceDir records get deletedUse a database that does not have migrations from any version of
v7.12.0ran on itEnsure that there are no duplicated SpAppResourceDir records, and if any were created that they have a "correct" DisciplineType (the name of the Discipline they're assigned to)