4.3 KiB
4.3 KiB
TODO: Migration to Unified Database-Ready Format
This is the checklist for migrating the GerbilManager Excel datasets (41 Stammbaum pedigree charts + 1 Wurfchronik litter chronicle) one-by-one into a clean, resolved, relational JSON format (gerbilmanager_resolved.json) that can be loaded directly into the database without on-the-fly reconciliation.
🟩 Phase 1: Preparation & Schema Definition
- Define the target unified JSON schema that maps 1-to-1 with the Entity Framework database entities:
Contacts(breeders/buyers)ColorVarieties(genetics catalog)Litters(with resolvedMotherIdandFatherIdGuid relations)Gerbils(with resolvedLitterId,ColorVarietyId,OriginContactId,ReceiverContactIdGuid relations)GerbilPhotos(mapped by Guid relation)
- Extract and verify existing
ColorVarietiesandContactsto establish basic lookup dictionaries.
🟦 Phase 2: Spreadsheet Extraction & Conversion (One-by-One)
Convert and extract each spreadsheet's records. For each chart, extract the animals, birth dates, death dates, genders (from cell background color), and genotypes.
Litter Chronicle
Wurfchronik der Kleine Chaoten Teil1.xlsx(Litters data base)
Pedigree Charts (Stammbäume)
Stammbaum von Akio Kids.xlsxStammbaum von Alberto Kids.xlsxStammbaum von CP-Fuchs, CP-Sa Sp von Unity.xlsxStammbaum von Chesnut.xlsxStammbaum von Danako.xlsxStammbaum von Ella.xlsxStammbaum von Emi.xlsxStammbaum von Fire Kids.xlsxStammbaum von Goldfuchs Sp (Pikachu) Kids.xlsxStammbaum von Hana.xlsxStammbaum von Jeremy.xlsxStammbaum von Jiminy of Black Forest.xlsxStammbaum von Jin.xlsxStammbaum von Kalea.xlsxStammbaum von Kazuya.xlsxStammbaum von Kentucky.xlsxStammbaum von Kohlief, Goldfuchsef Sp von Chrissi.xlsxStammbaum von Marlin of Black Forest.xlsxStammbaum von Martin.xlsxStammbaum von Oscar of Black Forest.xlsxStammbaum von Pinto of Fiomi.xlsxStammbaum von Quied Soldier of Black Forest.xlsxStammbaum von Rainny.xlsxStammbaum von Ren.xlsxStammbaum von South Dakota.xlsxStammbaum von Stella Kids.xlsxStammbaum von Tennessee.xlsxStammbaum von Unique of Wild Dreams.xlsxStammbaum von Unit.xlsxStammbaum von Uriana.xlsxStammbaum von Valentino Firehearts Kids.xlsxStammbaum von Vance.xlsxStammbaum von Vestra von den Schlossmäusen.xlsxStammbaum von Watarus Kids.xlsxStammbaum von Wildfire und Vestras Kids.xlsxStammbaum von Xelina.xlsxStammbaum von Yuki.xlsxStammbaum von Yurikas und Pintos Sohn.xlsxStammbaum von Zac (Vance.Dorie).xlsxStammbaum von Zenon von Elea.xlsxStammbaum von little Heros Sohn of little runners.xlsx
🟨 Phase 3: Resolution & Relational Mapping
- Resolve duplicates using the canonical key:
normalize(name) + normalize(dob)andZucht(breeding line). - Inject resolutions from
conflict-decisions.jsonto automatically resolve the remaining conflict animals (un-quarantining them and applying correct genotypes/dates). - Parse and map all parent-child relationships positionally from the pedigree charts.
- Map and link all animals to their respective Wurfchronik litters using parentage and DOB.
- Resolve photo attachments to actual extracted media file paths.
- Assign permanent UUIDs (Guids) to all records and replace string names in relationships with the actual UUID foreign keys.
🟧 Phase 4: Data Export & Validation
- Generate the final
resolved_import.jsoncontaining the relational array collections. - Run automated validation tests on the JSON file (check for circular dependencies, broken foreign keys, invalid genotypes, and null dates).
🟥 Phase 5: Loader Implementation & Database Ingestion
- Build a simplified loader utility (C# endpoint or local python script) that takes the resolved JSON and directly runs
INSERT/UPDATEtransactions. - Execute the import onto the target PostgreSQL database.
- Run verification tests (verify total counts: ~956 animals, and sample check pedigree trees).