gendesign/data/sql/147_location_demand_comment.sql
Light1YT 4b2e7d9af8
All checks were successful
CI / changes (push) Successful in 7s
CI / changes (pull_request) Successful in 6s
CI / frontend-tests (push) Has been skipped
CI / frontend-tests (pull_request) Has been skipped
CI / backend-tests (push) Successful in 6m27s
CI / backend-tests (pull_request) Successful in 6m26s
Deploy / changes (push) Successful in 5s
Deploy / build-frontend (push) Has been skipped
Deploy / build-backend (push) Successful in 4m52s
Deploy / build-worker (push) Successful in 13m20s
Deploy / deploy (push) Successful in 1m18s
fix(db): sync location.demand_index comment to city-relative (#948)
The demand_index DB column comment still said "насыщающее преобразование"
(saturating) after #1167 switched it to city-relative normalization —
exactly the misleading-comment class that hid the original bug. Migration
147 updates COMMENT ON COLUMN (idempotent, comment-only, no data DDL).

Refs #948
2026-06-08 14:04:51 +05:00

20 lines
1.7 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 147_location_demand_comment.sql
-- #948 / #1167: demand_index перешёл с saturating-АБСОЛЮТНОЙ нормировки
-- (clamp01(unit_velocity / 50), фикс. константа) на CITY-RELATIVE: район /
-- max-скорость по городу за прогон refresh_locations (зеркало infra_index).
--
-- Причина: на live-прогоне ВСЕ 8 районов ЕКБ давали demand=1.0 (каждый продаёт
-- ≥50 кв/мес → индекс насыщался в 1.0 везде → ноль дискриминации). См. PR #1167.
--
-- Эта миграция ТОЛЬКО синхронизирует DB-комментарий столбца с новым кодом — старый
-- текст «насыщающее преобразование» теперь врёт (ровно класс «вводящего в
-- заблуждение комментария», который и спрятал баг). Idempotent: COMMENT ON
-- безопасен к повторному применению; никакого DDL над данными.
--
-- Deploy: auto-applied deploy.yml через _schema_migrations (ровно один раз по NN).
-- Требует таблицу `location` из 146 (147 > 146 лексикографически → применяется после).
COMMENT ON COLUMN location.demand_index IS
'Индекс спроса 0..1: city-relative нормировка market_metrics.unit_velocity '
'(скорость продаж района / max-скорость по городу за прогон refresh_locations). '
'NULL при недостатке данных (никогда не фабрикуем 0).';