Patch migration to dedupe and merge picklists #7454
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 #3970
Create a patch migration to de-duplicate and merge picklists. Before deleting duplicates, merge the picklist items into one of the picklists to make sure no items are missing. This is to resolve duplicate picklists that were created in Specify 6.
For the purposes of this PR, we have decided that two picklists are considered duplicates if they are identical on all the following fields:
Unfortunately, picklists are only differentiated by name in the schema and workbench. Also, there might be cases where two picklists have the same name, but have different types/tables/etc. Those would be special cases that would be difficult to categorize as duplicates or not, depending on the user's intent. This PR focuses I identifying, deduplicating, and merging picklists that are certain to be duplicates based on those four fields.
Might want to also add this patch migration to the key migrations command.
When merging together picklistitems from a group of duplicate picklists, the following fields are compared:
Checklist
self-explanatory (or properly documented)
Testing instructions