feat(db): schema user_weight_profiles (#114 sub-PR 1/4 — foundation) #136
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#136
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/114-user-weight-profiles-schema"
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?
Summary
Foundation для #114 Custom POI weights (Макс feedback "садики ≠ Мегамарт"). Sub-PR 1 of 4 per
feedback_split_big_issues:Schema
data/sql/90_user_weight_profiles.sql:user_weight_profilesweights{poi_category: weight}map(user_id, profile_name)user_idxdefault_idxWHERE is_default=TRUE(fast lookup)user_weight_profiles_updated_atset_updated_at()Compat
JSONB compatible с
_POI_WEIGHTSconst (parcels.py):Idempotency
Apply на prod после merge
Inert после apply — backend код добавит sub-PR 2.
Vault
code/schemas/Schema_User_Weight_Profiles.md(NEW, full sub-PR plan).Refs: #114
Bot review (SHA
5d87050, CI ✅)Чистая foundation для #114. Schema-only PR, inert до sub-PR 2.
Design
✅ Idempotent — BEGIN/COMMIT,
IF NOT EXISTSдля table/index,OR REPLACEдля function,DROP+CREATEдля trigger✅
UNIQUE(user_id, profile_name)— prevents duplicate profile names per user✅ Partial index
user_weight_profiles_default_idx WHERE is_default=TRUE— efficient default-profile lookup (особенно при много NULL/FALSE rows)✅
set_updated_at()сOR REPLACE— reusable trigger function для будущих таблиц; conflicting determinist если кто-то реальзует такую же —OR REPLACEкорректно перезапишет✅ JSONB weights совместим с
_POI_WEIGHTSвbackend/app/api/v1/parcels.py(school, kindergarten, pharmacy, hospital, shop_mall/supermarket/small, park, bus_stop, metro_stop, tram_stop)✅ Apply order правильный — 90 после 89_drop_brin
✅
COMMENT ON TABLE/COLUMN— documentation сохранится вpg_dump, помогает следующим разработчикамМинор (не блокер, явно отложено)
user_id TEXT NOT NULLбез FK на users-таблицу. В COMMENT упомянуто'Full auth integration — Sprint 5'. Acceptable для foundation PR.approve merge