-- Migration 113: yandex detail backfill — новые колонки + seed расписания. -- -- Добавляет в listings три колонки, которых нет ни в 002_core_tables.sql ни в более ранних -- migrations, но которые парсит YandexDetailScraper.DetailEnrichment: -- -- photo_urls jsonb -- список URL фото из Product JSON-LD image[] -- newbuilding_url text -- ссылка на ЖК (/kupit/novostrojka/...) если есть -- newbuilding_id text -- id ЖК из URL (числовая строка) -- -- Уже существующие колонки (не дублируем): -- rooms, area_m2, floor, total_floors, address, description, repair_state, -- publish_date, metro_stations, detail_enriched_at -- 002/011_*.sql -- views_total_yandex, publish_date_relative, agency_name, -- agency_founded_year, agency_objects_count -- 033_listings_alter_yandex.sql -- -- Seed scrape_schedules: source='yandex_detail_backfill', window 12-15 UTC, -- разнесено с avito_detail_backfill (09-12 UTC) чтобы не делить трафик. -- ON CONFLICT DO NOTHING — идемпотентно. BEGIN; -- ── listings — новые колонки для detail enrichment ──────────────────────────── ALTER TABLE listings ADD COLUMN IF NOT EXISTS photo_urls jsonb, -- [url, ...] из Product JSON-LD image[] ADD COLUMN IF NOT EXISTS newbuilding_url text, -- ссылка на ЖК (/kupit/novostrojka/...) ADD COLUMN IF NOT EXISTS newbuilding_id text; -- id ЖК из URL (числовая строка) -- ── scrape_schedules — seed yandex_detail_backfill ──────────────────────────── INSERT INTO scrape_schedules (source, enabled, window_start_hour, window_end_hour, next_run_at, default_params) VALUES ( 'yandex_detail_backfill', true, 12, -- 12:00 UTC = 15:00 МСК 15, -- 15:00 UTC = 18:00 МСК (NOW() + INTERVAL '1 day')::date + TIME '12:00:00' + INTERVAL '0 second', '{"batch_size": 800, "budget_sec": 3600, "request_delay_sec": 5, "max_consecutive_blocks": 5}'::jsonb ) ON CONFLICT (source) DO NOTHING; COMMENT ON TABLE scrape_schedules IS 'Периодические задачи: avito/yandex/n1/cian city sweep, rosreestr import, ' 'listing snapshot, ratio refresh, geocode backfill, deactivate stale, ' 'sber/rosreestr quarter poll, newbuilding enrich, yandex newbuilding sweep, ' 'avito detail backfill, yandex detail backfill.'; COMMIT;