Add data export/import to migrate between spoolbook installs - #130
Merged
Merged
Conversation
Closes #129. Grilled via /grill-with-docs, design in docs/adr/0033: a zip bundle (manifest.json + bundled .3mf files) merged into the target install rather than replacing it -- Filament/Printer/FilamentColor dedupe by natural key, everything else always inserts with every foreign key remapped from source ids to whatever the target actually assigns. Preview step reports per-table counts before anything commits, since most tables have no natural identity to dedupe a re-import against. Implemented via one generic row<->JSON mechanism (row_to_json/ insert_json_row) reused across every table instead of hand-written structs per table -- print_profiles alone has ~140 columns. Settings page gets a new Data section (Export button, Import file-picker -> preview -> confirm). Verified end-to-end in a real browser against the real dev DB (3231 filaments, 1391 colors, real prints/profiles/projects): preview correctly reported everything already-existing, confirming the dedupe rules hold on real data, not just synthetic tests. A first pass at this test also surfaced and fixed a real gap -- FilamentColor wasn't deduped like Filament/Printer, so a self-import added 1391 duplicate colors before the rule existed. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Closes #129. Grilled via /grill-with-docs, design in docs/adr/0033: a zip bundle (manifest.json + bundled .3mf files) merged into the target install rather than replacing it -- Filament/Printer/FilamentColor dedupe by natural key, everything else always inserts with every foreign key remapped from source ids to whatever the target actually assigns. Preview step reports per-table counts before anything commits, since most tables have no natural identity to dedupe a re-import against.
Implemented via one generic row<->JSON mechanism (row_to_json/ insert_json_row) reused across every table instead of hand-written structs per table -- print_profiles alone has ~140 columns. Settings page gets a new Data section (Export button, Import file-picker -> preview -> confirm).
Verified end-to-end in a real browser against the real dev DB (3231 filaments, 1391 colors, real prints/profiles/projects): preview correctly reported everything already-existing, confirming the dedupe rules hold on real data, not just synthetic tests. A first pass at this test also surfaced and fixed a real gap -- FilamentColor wasn't deduped like Filament/Printer, so a self-import added 1391 duplicate colors before the rule existed.