gendesign/tradein-mvp/backend/data/sql
lekss361 0db71033b4
All checks were successful
Deploy Trade-In / changes (push) Successful in 4s
Deploy Trade-In / build-frontend (push) Has been skipped
Deploy Trade-In / deploy (push) Successful in 20s
Deploy Trade-In / build-backend (push) Successful in 21s
fix(tradein): 030 — UNIQUE constraint on avito_imv_evaluations.cache_key (unblocks PR #452) (#454)
Hotfix unblocking PR #452 (Stage 3 IMV estimator integration).

Adds 030_avito_imv_cache_key_unique.sql: creates UNIQUE INDEX imv_cache_key_uniq_idx
on avito_imv_evaluations(cache_key), allowing save_imv_evaluation's ON CONFLICT (cache_key)
DO UPDATE to resolve. Migration 018 only created a non-unique composite index, which would
have caused runtime error on first IMV cache write.

DELETE-USING dedup guards against historical duplicates (no-op on fresh table).
BEGIN/COMMIT atomic; IF NOT EXISTS idempotent; CONCURRENTLY unnecessary (table empty).

Lexicographic apply order with PR #453's 030_listings_alter_yandex.sql is safe — different
tables, no functional interaction.

Reviewed by deep-code-reviewer: APPROVE.
2026-05-23 13:04:21 +00:00
..
001_trade_in_estimates.sql feat: add tradein-mvp subproject (Trade-In Estimator под /trade-in) 2026-05-21 00:25:39 +03:00
002_core_tables.sql feat: add tradein-mvp subproject (Trade-In Estimator под /trade-in) 2026-05-21 00:25:39 +03:00
003_seed_deals.sql fix(tradein): убрать TRUNCATE из seed — деплой больше не wipe-ит данные 2026-05-21 13:19:24 +03:00
004_extend_trade_in_estimates.sql feat: add tradein-mvp subproject (Trade-In Estimator под /trade-in) 2026-05-21 00:25:39 +03:00
005_geocode_tracking.sql feat(tradein): geocode-missing для deals (#4 завершение) 2026-05-21 20:04:19 +03:00
006_cad_buildings.sql feat(tradein): кадастр зданий как источник house_metadata (#393) 2026-05-22 10:54:42 +05:00
007_estimate_photos.sql feat(tradein): backend загрузки фото квартиры (#394) 2026-05-22 11:05:35 +05:00
008_crm_fields.sql feat(tradein): CRM-поля в форме оценки (#395) 2026-05-22 11:15:15 +05:00
009_houses.sql feat(tradein): SQL migrations 009-018 — houses + listings extension + IMV cache (#440) 2026-05-23 11:41:44 +00:00
010_houses_alter.sql feat(tradein): SQL migrations 009-018 — houses + listings extension + IMV cache (#440) 2026-05-23 11:41:44 +00:00
011_listings_alter.sql feat(tradein): SQL migrations 009-018 — houses + listings extension + IMV cache (#440) 2026-05-23 11:41:44 +00:00
012_sellers.sql feat(tradein): SQL migrations 009-018 — houses + listings extension + IMV cache (#440) 2026-05-23 11:41:44 +00:00
013_listings_alter_seller.sql feat(tradein): SQL migrations 009-018 — houses + listings extension + IMV cache (#440) 2026-05-23 11:41:44 +00:00
014_house_reviews.sql feat(tradein): SQL migrations 009-018 — houses + listings extension + IMV cache (#440) 2026-05-23 11:41:44 +00:00
015_scrape_runs.sql feat(tradein): SQL migrations 009-018 — houses + listings extension + IMV cache (#440) 2026-05-23 11:41:44 +00:00
016_listings_snapshots.sql feat(tradein): SQL migrations 009-018 — houses + listings extension + IMV cache (#440) 2026-05-23 11:41:44 +00:00
017_house_placement_history.sql feat(tradein): SQL migrations 009-018 — houses + listings extension + IMV cache (#440) 2026-05-23 11:41:44 +00:00
018_avito_imv_evaluations.sql feat(tradein): SQL migrations 009-018 — houses + listings extension + IMV cache (#440) 2026-05-23 11:41:44 +00:00
019_listings_alter_cian.sql feat(tradein): SQL migrations 019-028 — Cian schema + matching + cookies 2026-05-23 15:14:49 +03:00
020_houses_alter_cian.sql feat(tradein): SQL migrations 019-028 — Cian schema + matching + cookies 2026-05-23 15:14:49 +03:00
021_management_companies.sql feat(tradein): SQL migrations 019-028 — Cian schema + matching + cookies 2026-05-23 15:14:49 +03:00
022_agents_table.sql feat(tradein): SQL migrations 019-028 — Cian schema + matching + cookies 2026-05-23 15:14:49 +03:00
023_offer_price_history.sql feat(tradein): SQL migrations 019-028 — Cian schema + matching + cookies 2026-05-23 15:14:49 +03:00
024_houses_price_dynamics.sql feat(tradein): SQL migrations 019-028 — Cian schema + matching + cookies 2026-05-23 15:14:49 +03:00
025_house_reliability_checks.sql feat(tradein): SQL migrations 019-028 — Cian schema + matching + cookies 2026-05-23 15:14:49 +03:00
026_external_valuations.sql feat(tradein): SQL migrations 019-028 — Cian schema + matching + cookies 2026-05-23 15:14:49 +03:00
027_cian_session_cookies.sql feat(tradein): SQL migrations 019-028 — Cian schema + matching + cookies 2026-05-23 15:14:49 +03:00
028_matching_tables.sql feat(tradein): SQL migrations 019-028 — Cian schema + matching + cookies 2026-05-23 15:14:49 +03:00
029_extend_matching_valuation_dynamics.sql feat(tradein): SQL migration 029 — extend matching/valuation/dynamics tables (PR #445 follow-up) (#448) 2026-05-23 12:35:03 +00:00
030_avito_imv_cache_key_unique.sql fix(tradein): 030 — UNIQUE constraint on avito_imv_evaluations.cache_key (unblocks PR #452) (#454) 2026-05-23 13:04:21 +00:00
030_listings_alter_yandex.sql feat(tradein): SQL migrations 030-032 — Yandex schema (listings/houses/history) (#453) 2026-05-23 13:00:54 +00:00
031_houses_alter_yandex.sql feat(tradein): SQL migrations 030-032 — Yandex schema (listings/houses/history) (#453) 2026-05-23 13:00:54 +00:00
032_yandex_history.sql feat(tradein): SQL migrations 030-032 — Yandex schema (listings/houses/history) (#453) 2026-05-23 13:00:54 +00:00