gendesign/tradein-mvp/backend
Light1YT f1141f3578
All checks were successful
CI / changes (pull_request) Successful in 6s
CI / backend-tests (pull_request) Has been skipped
CI / frontend-tests (pull_request) Has been skipped
CI / openapi-codegen-check (pull_request) Has been skipped
fix(migration-133): dedup via cascade-delete, not child re-point (prod hotfix)
Migration 133 FAILED on prod: offer_price_history has UNIQUE (listing_id,
change_time), but the re-point UPDATE moved ALL loser rows to the keeper →
duplicate key violation (the deep-review validated on a throwaway schema subset
that lacked this constraint). A keeper-only NOT EXISTS guard is also insufficient
— multiple losers in one (source,source_id) group share a change_time, so they
collide WITH EACH OTHER inside the single UPDATE (same vulnerability for
listings_snapshots PK + external_valuations partial-UNIQUE).

Fix: drop all data-child re-points; rely on FK ON DELETE CASCADE (all four FKs
are confdeltype='c') to clean loser children when losers are deleted. Keep only
the collision-free merged_into re-point. These are duplicates of the SAME offer —
the keeper retains its own full history; loser-dup history is redundant.

Dry-run on prod (BEGIN…ROLLBACK): 9840 groups, 9889 losers deleted, index
created, abort-guard passed, zero errors. Migration 133 never applied anywhere
(absent from _schema_migrations), so amending it in place is safe.

Refs #1773
2026-06-26 13:14:57 +05:00
..
app fix(cian): recover new-build house via cadastral anchor + listings (source,source_id) dedup (#1773) (#1912) 2026-06-26 07:45:22 +00:00
data/sql fix(migration-133): dedup via cascade-delete, not child re-point (prod hotfix) 2026-06-26 13:14:57 +05:00
scripts fix(backfill): drop nonexistent kadastr_num column from listings SELECT 2026-06-17 23:47:30 +03:00
tests fix(cian): recover new-build house via cadastral anchor + listings (source,source_id) dedup (#1773) (#1912) 2026-06-26 07:45:22 +00:00
.dockerignore feat: add tradein-mvp subproject (Trade-In Estimator под /trade-in) 2026-05-21 00:25:39 +03:00
Dockerfile feat(browser): split camoufox into tradein-browser container, connect-mode (#905) 2026-05-31 17:24:35 +03:00
pyproject.toml fix(scrapers/backend): socks5 health-probe (httpx[socks]) + status Literal whitelist + #1820 ext_id=0 dedup-гард 2026-06-20 10:17:37 +03:00