fix: Migration 027 constraint violation - health mode sum
All checks were successful
Deploy Development / deploy (push) Successful in 48s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 14s

Fixed health mode calculation in focus_areas migration.
Changed health_pct from 50 to 55 to ensure sum equals 100%.

Before: 0+0+10+20+15+50 = 95% (constraint violation)
After:  0+0+10+20+15+55 = 100% (valid)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Lars 2026-03-27 10:53:39 +01:00
parent d97925d5a1
commit 80d57918ae

View File

@ -104,7 +104,7 @@ SELECT
END AS flexibility_pct, END AS flexibility_pct,
CASE goal_mode CASE goal_mode
WHEN 'health' THEN 50 ELSE 0 WHEN 'health' THEN 55 ELSE 0
END + END +
CASE goal_mode CASE goal_mode
WHEN 'endurance' THEN 20 ELSE 0 WHEN 'endurance' THEN 20 ELSE 0