fix(db): sync location.demand_index comment to city-relative (#948)
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
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
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
This commit is contained in:
parent
379af88424
commit
4b2e7d9af8
1 changed files with 20 additions and 0 deletions
20
data/sql/147_location_demand_comment.sql
Normal file
20
data/sql/147_location_demand_comment.sql
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
-- 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).';
|
||||
Loading…
Add table
Reference in a new issue