Importer leaves orphaned tables behind when a layer or a zoom level goes away #12
Labels
No labels
claude-wip
map-report
map:is
map:se
needs-review
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
art/ismap#12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Two symptoms, one root cause: the swap only ever touches the tables the current config
declares, so anything the config used to declare is left in the database forever.
zxy_functions. UnificationPhase 2 hit this for real —
ismap_/se_/plmap_background_land_*and their functions hadto be dropped by hand, and Phases 4 and 5 paid the same tax (26 tables and 6 functions
in one case).
maxzleaves the higher zoom tables behind (e.g. old z14/z15/z16after lowering to z13).
Both want the same fix, in the swap transaction: drop any
<prefix>_<layer>_<z>outsidethe new zoom range, and drop tables/functions for layers the config no longer declares.
Be careful with the second half. A
-layerimport only knows about the layers it wasasked for, and several configs share one database, so "not declared by this config" is not
the same as "orphaned" — the check has to be scoped to the config's own prefix and only
run on a full import, or it will delete another country's tables. Consider making it
opt-in (
-prune) rather than automatic.