-
Notifications
You must be signed in to change notification settings - Fork 162
Open
Labels
refactoringTechnical refactoring of an existing featureTechnical refactoring of an existing featuretaskSomething to be done that does not directly affect the softwareSomething to be done that does not directly affect the software
Description
Problem Description
Part of Epic: [Epic] PathogenClassification: Replace GenoTypeResult & SeroGroupSpecification enums
Blocked by: Phase 8
Write the SQL migration that creates the new table, seeds all classification values,
migrates existing pathogentest rows, and drops the old columns.
Proposed Solution
Tasks
-
CREATE TABLE pathogenclassificationwith columns:id,uuid,value,caption,disease,classification_type,parent_id,depth,active,archived,changedate,creationdate - Create indexes:
idx_pathogenclassification_disease,idx_pathogenclassification_parent - Seed all Measles genotypes (23 values from
GenoTypeResult) - Seed Cryptosporidiosis species (5 values: CRYPTOSPORIDIUM_HOMINIS, CRYPTOSPORIDIUM_PARVUM, CRYPTOSPORIDIUM_SPECIES, OTHER, UNKNOWN)
- Seed IMI serogroups (12 values from
SeroGroupSpecification) -
ALTER TABLE pathogentest ADD COLUMN pathogenclassification_id BIGINT REFERENCES pathogenclassification(id) -
ALTER TABLE pathogentest ADD COLUMN pathogenclassificationdetails VARCHAR(512) -
UPDATE pathogentest— migrategenotyperesult→pathogenclassification_idlookup -
UPDATE pathogentest— migrateserogroupspecification→pathogenclassification_idlookup (don't overwrite if genotype already set) - After verification:
DROP COLUMN genotyperesult, genotyperesulttext, serogroupspecification, serogroupspecificationtext - Verify
serotype,serotypingmethod,serotypingmethodtextcolumns are untouched
Additional Information
Acceptance Criteria
- Row counts before/after migration are equal (zero data loss)
- Spot-check: records with
genoTypeResult = OTHERhavepathogenClassificationDetailspopulated - Spot-check: records with
seroGroupSpecification != nullmapped to correctpathogenclassification_id - Old columns dropped cleanly
serotype/serotypingmethodcolumns still populated and intact
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
refactoringTechnical refactoring of an existing featureTechnical refactoring of an existing featuretaskSomething to be done that does not directly affect the softwareSomething to be done that does not directly affect the software