feat(tradein): SQL 040-046 — matching schema delta (Phase 1.1) #464

Merged
lekss361 merged 1 commit from feat/tradein-matching-schema into main 2026-05-23 13:30:23 +00:00

1 commit

Author SHA1 Message Date
lekss361
d019b5327e feat(tradein): SQL 040-046 — matching schema delta (Phase 1.1)
Multi-Source Integration Phase 1.1 thin-delta migrations. Gap audit showed
80%+ of planned schema already in 014/017/020/026/028/029/030/031 —
this PR adds only the missing pieces:

- 040 houses_extend: complex_id + avito_validated_at + cian_validated_at
- 041 house_sources_noop: COMMENT aliases for ext_source/ext_id/matched_method
- 042 listing_sources_price_divergence_idx: partial index for /search
- 043 house_reviews_extend: likes column
- 044 external_valuations_link: house_id/listing_id FKs + low/high price band
- 045 house_placement_history_extend: source_confidence + notes + 3-col UNIQUE
- 046 views: v_price_divergence + v_cross_source_health + v_data_quality

All BEGIN/COMMIT, IF NOT EXISTS, FK ON DELETE CASCADE.
Idempotent — safe re-apply on prod.

Refs Master Plan sec 1, 4-8 + Cross_Source_Matching sec 2-4.
2026-05-23 16:22:58 +03:00