feat(tradein): SQL migrations 030-032 — Yandex schema (listings/houses/history) #453
No reviewers
Labels
No labels
admin
analytics
auth
automation
bug
business
chore
ci
compliance
data
data-moat
docs
duplicate
dx
enhancement
Fable 5 ревью
feedback/max
generative
GG-форсайт
needs-discussion
needs-human
observability
pause-bots
performance
priority/p0
priority/p1
priority/p2
priority/p3
scope/backend
scope/db
scope/devops
scope/frontend
scope/qa
scrapers
security
site-finder
stage/1
stage/2
status/blocked
status/done
status/needs-analysis
status/needs-fix
status/qa
status/ready
status/review
status/wip
tech-debt
tradein
ux
week ревью 1
wontfix
вторичка
ИРД
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#453
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/tradein-yandex-migrations"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Motivation
Foundation DDL for YandexRealtyScraper v1 (Stage 1 of 9). Adds Yandex-specific columns to
listingsandhouses, and registerssource='yandex_valuation'on the existinghouse_placement_historytable. Stages 2–9 (parsers, matchers, enrichment) follow in subsequent PRs.Numbered 030–032 because 029 was already consumed by PR #448 (matching/valuation/dynamics extensions merged earlier today).
Files
030_listings_alter_yandex.sqllistings031_houses_alter_yandex.sqlhouses032_yandex_history.sqlhouse_placement_historyColumn inventory
030 — listings
yandex_offer_id text— numeric string offer ID kept as textviews_total_yandex int— parallel to Cian’sviews_total; separate column to preserve source attributionpublish_date_relative text— raw "цасов назад" / "вчера" stringsale_type_text text— raw RU phrase (свободная продажа / альтернативная)agency_name text,agency_founded_year int,agency_objects_count int— OfferCardAuthorInfo block031 — houses
yandex_jk_id text,yandex_jk_slug text— Yandex newbuilding (ЖК) identifierscommission_year int,commission_month text— commissioning date (raw RU month)total_area_ha numeric(6,2),corpus_count int— ЖК footprint/corpus metadatayandex_validated_at timestamptz,yandex_total_listings int,has_panorama boolean— Valuation tool enrichment fields032 — house_placement_history
COMMENT ON COLUMN sourceto documentyandex_valuationvalue.hph_source_idx(source) andhph_house_source_idx(house_id, source, last_price_date DESC WHERE house_id IS NOT NULL).Smoke verification
The MCP tunnel (
localhost:15432) connects to the main gendesign DB which does not contain the tradein schema (listings,houses,house_placement_history). Smoke verification is deferred to deploy via the existingapply_sql_migrationsstep indeploy.yml. All migrations are idempotent (ADD COLUMN IF NOT EXISTS,CREATE INDEX IF NOT EXISTS) — safe for repeated application.Reviewer note
Reviewer: deep-code-reviewer — only merge after APPROVE.
Merged via deep-code-reviewer — verdict APPROVE (squash, commit
f452b13).Review summary
data/sql/**), +117/-0ADD COLUMN IF NOT EXISTS+CREATE INDEX IF NOT EXISTS, BEGIN/COMMIT wrapped, COMMENT overwrites — safe re-runforgejo/main(last was 029 from PR #448). No collision.house_placement_history.source: verified no CHECK constraint in 017 — new valueyandex_valuationaccepted without DDL changeviews_total_yandexvs existingviews_total(Cian) → parallel cols preserve source attribution ✅.sale_type_textvs existingsale_typeenum → no collision ✅decisions/YandexRealtyScraper_v1_Implementation_Plan.mdStage 1 spec satisfied (sec 11.6 listings, sec 23.3 houses, sec 13.2 history)tradein-mvp/backend/**matches.forgejo/workflows/deploy-tradein.ymlfilter → triggers; apply loopls -1 backend/data/sql/*.sql | sort→ 030→031→032 lexicographic orderNumbering impact for PR #452 (IMV cache_key UNIQUE)
PR #452 (
030_avito_imv_cache_key_unique.sqlon WIP branch) must be renumbered to033_avito_imv_cache_key_unique.sqlbefore merge — slot 030 is now occupied by Yandex listings migration.Lexicographic apply order after both merge: 029 → 030 (Yandex listings) → 031 (Yandex houses) → 032 (Yandex history) → 033 (IMV UNIQUE). The IMV UNIQUE migration has no dependency on Yandex DDL — apply order doesn't matter functionally.
Post-merge
Deploy workflow
deploy-tradein.ymlshould fire on push to main. Expected log lines:Smoke verification (
\d listings/\d houses) after Stage 2+ scraper parsers land.