gendesign/tradein-mvp/deploy
Light1YT b51893f7c3 fix(tradein): plain natural-key dedup_hash for rosreestr deals (#576)
rosreestr ДКП deals used dedup_hash = md5('ros:dkp:' || id) — a hash of
an already-unique natural key. The md5 is collision-prone (theoretically),
not human-readable, and irreversible (can't recover the source id from it,
which mattered because deals.source_id was never populated).

Replace with the plain natural key 'ros:dkp:' || id (injective, zero
collision, reversible) and populate deals.source_id going forward, in both
the live scheduler import (import_rosreestr_dkp) and the legacy
deploy/import-rosreestr.sh.

Migration 077 backfills the existing 49,791 rows: recovers the original id
from FDW foreign table gendesign_rosreestr_deals by matching the old md5,
then writes the plain key + source_id. Idempotent; plain keys and md5 hex
are format-disjoint so no transient UNIQUE violation on deals_dedup_hash_key.
Verified via prod dry-run (ROLLBACK): UPDATE 49791, 0 md5 remaining, 3.85s.

Closes #576
2026-05-29 11:55:15 +05:00
..
avito-city-sweep.sh feat(tradein): city sweep — auto ЕКБ pipeline (#477) 2026-05-23 14:38:07 +00:00
backup-tradein-db.sh feat(tradein): бэкап tradein-postgres по cron (#397) 2026-05-22 11:22:30 +05:00
Caddyfile feat: add tradein-mvp subproject (Trade-In Estimator под /trade-in) 2026-05-21 00:25:39 +03:00
Caddyfile.tradein-fragment feat: add tradein-mvp subproject (Trade-In Estimator под /trade-in) 2026-05-21 00:25:39 +03:00
cron-scrape.sh fix(tradein): убрать require_admin полностью — Caddy basic_auth достаточен (#474) 2026-05-23 14:21:01 +00:00
import-rosreestr.sh fix(tradein): plain natural-key dedup_hash for rosreestr deals (#576) 2026-05-29 11:55:15 +05:00