fix(db): retire all legacy cad_buildings indexes — hotfix2 (#168) #174
No reviewers
Labels
No labels
admin
analytics
auth
automation
bug
business
chore
ci
compliance
data
data-moat
docs
duplicate
dx
enhancement
Fable 5 ревью
feedback/max
generative
GG-форсайт
needs-discussion
needs-human
observability
pause-bots
performance
priority/p0
priority/p1
priority/p2
priority/p3
scope/backend
scope/db
scope/devops
scope/frontend
scope/qa
scrapers
security
site-finder
stage/1
stage/2
status/blocked
status/done
status/needs-analysis
status/needs-fix
status/qa
status/ready
status/review
status/wip
tech-debt
tradein
ux
week ревью 1
wontfix
вторичка
ИРД
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#174
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix/cadastre-schema-all-pkey-rename"
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?
Summary
cad_buildings_geom_gistcad_buildings_old_apr26Error from latest deploy
Fix
Добавлены 5 дополнительных
ALTER INDEX IF EXISTS RENAME TO _old_apr26_*строк (всего 6 retires перед 6 renames):cad_buildings_pkey(уже было в #173)cad_buildings_geom_gist(new)cad_buildings_quarter_idx(new)cad_buildings_objdoc_idx(new)cad_buildings_complex_idx(new)cad_buildings_purpose_idx(new)IF EXISTSmakes it idempotent.State on prod
Migration 92 transaction rolled back 4× now → NOT в
_schema_migrations.После merge → next deploy re-runs migration 92 fresh с full fix.
Closes hotfix2 of #168.
Final review — CI ✅, fix exhaustive by construction
Cross-checked агентом — fix complete, не reactive guesswork.
Symmetry verification
✅ 6 retired legacy names = exact 1:1 mirror of 6 CREATE INDEX statements (lines 316-327 в migration) = 6
_new_*→ unsuffixed renames (lines 513-520):cad_buildings_pkey(#173)cad_buildings_new_pkeycad_buildings_pkeycad_buildings_geom_gistcad_buildings_new_geom_gistcad_buildings_geom_gistcad_buildings_quarter_idxcad_buildings_new_quarter_idxcad_buildings_quarter_idxcad_buildings_objdoc_idxcad_buildings_new_objdoc_idxcad_buildings_objdoc_idxcad_buildings_complex_idxcad_buildings_new_complex_idxcad_buildings_complex_idxcad_buildings_purpose_idxcad_buildings_new_purpose_idxcad_buildings_purpose_idxSchema self-consistent: pre-K.1 backup
cad_buildingsимел тот же index layout что новыйcad_buildings_new. Fix exhaustive by construction, not enumeration guesswork.Hotfix3 risk
Extremely unlikely — barring manual DBA-добавленные indexes outside migrations.
IF EXISTStolerates absence even в этом случае; и любой extra legacy index не может collide с 6 known_new_*targets.Idempotency
✅ Все 6 renames
ALTER INDEX IF EXISTS ... RENAME TO ..._old_apr26_*— matches pattern below✅ Re-runnable on partial state
Prod state
✅ Migration 92 rolled back 4× → NOT в
_schema_migrations→ edit in-place корректно✅ CI green (backend + frontend SUCCESS)
✅ mergeable=MERGEABLE
✅ Никаких manual ops не требуется
approve merge