fix(db): #1781 backfill listings.house_id_fk from house_sources (cian novostroyki) #1784

Merged
lekss361 merged 1 commit from fix/1781-cian-novostroyki-fk-backfill into main 2026-06-19 14:56:10 +00:00

1 commit

Author SHA1 Message Date
8adbbef88c fix(db): #1781 backfill listings.house_id_fk from house_sources
All checks were successful
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
CI / changes (pull_request) Successful in 6s
The realtime FK mirror (base.py:607-616) only landed 2026-06-17 (e63b21e).
Listings matched into house_sources before that — notably 9205 cian novostroyki
frozen at 2026-05-31 — never had house_id_fk mirrored back, breaking the
canonical "same-building via house_id_fk" estimator path (93% of active cian
novostroyki had NULL fk citywide).

Add data/sql/130_backfill_listings_house_id_fk.sql: deterministic source-id
backfill via house_sources (ext_source, ext_id → house_id), idempotent
(WHERE house_id_fk IS NULL), no fuzzy/address fallback. Prod (read-only):
9235/9235 target rows resolve deterministically, zero unresolvable. One-time
backlog drain; future rows linked in realtime by the e63b21e mirror.
2026-06-19 16:20:32 +05:00