Decommission ROR Schema v1 indexing support #512
Merged
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.
Purpose
The purpose of this PR is to decommission support for ROR Schema v1 during the indexing and data setup processes. This ensures that all future data updates and index creations strictly use the Schema v2 format, while maintaining backward compatibility for queries against existing v1 indices where necessary.
Approach
The approach involves removing logic branches that handled v1 indexing in management commands and views. The system now defaults to Schema v2 for all indexing operations.
Key Modifications
IndexDataDumpto always useschema = 2regardless of the version passed in the request.createindex.py: Removed logic to create v1 indices; it now exclusively creates v2 indices.deleteindex.py: Focused deletion logic on v2 indices.indexror.py: Removed v1-specific field mapping functions (get_nested_names_v1,get_nested_ids_v1) and enforced a check that only v2 is supported.indexrordump.py: Updated logic to detect v2.0+ filenames (e.g.,v2.x.json) and removed the ability to index v1 JSON files.setup.py: Restricted the--schemaargument choice to2and updated success messages.INDEX_V1variable name for backward compatibility in API queries, but removed the associated v1 index template path to prevent accidental v1 index creation.Important Technical Details
indexrordump.py, a regex was added to support both the legacyschema_v2naming convention and the newerv{major}.{minor}semantic versioning filenames for data dumps.organizations(v1) index name is still referenced in settings to ensure existing read-only v1 API endpoints continue to function against the last indexed v1 data.Types of changes