mitai-jinkendo/backend/migrations
Lars 65ee5f898f
All checks were successful
Deploy Development / deploy (push) Successful in 43s
Build Test / lint-backend (push) Successful in 1s
Build Test / build-frontend (push) Successful in 13s
feat: Phase 1.5 - Flexible Goal System (DB-Registry) Part 1/2
KRITISCHE ARCHITEKTUR-ÄNDERUNG vor Phase 0b:
Ermöglicht dynamische Goal Types ohne Code-Änderungen.

Backend:
- Migration 024: goal_type_definitions Tabelle
  → 8 existierende Typen als Seed-Data migriert
  → Flexible Schema: source_table, aggregation_method, calculation_formula
  → System vs. Custom Types (is_system flag)
- goal_utils.py: Universal Value Fetcher
  → get_current_value_for_goal() ersetzt hardcoded if/elif chain
  → Unterstützt: latest, avg_7d, avg_30d, sum_30d, count_7d, etc.
  → Komplexe Formeln (lean_mass) via calculation_formula JSON
- goals.py: CRUD API für Goal Type Definitions
  → GET /goals/goal-types (public)
  → POST/PUT/DELETE /goals/goal-types (admin-only)
  → Schutz für System-Types (nicht löschbar)
- goals.py: _get_current_value_for_goal_type() delegiert zu Universal Fetcher

Frontend:
- api.js: 4 neue Funktionen (listGoalTypeDefinitions, create, update, delete)

Dokumentation:
- TODO_GOAL_SYSTEM.md: Phase 1.5 hinzugefügt, Roadmap aktualisiert

Part 2/2 (nächster Commit):
- Frontend: Dynamic Goal Types Dropdown
- Admin UI: Goal Type Management Page
- Testing

Warum JETZT (vor Phase 0b)?
- Phase 0b Platzhalter (120+) nutzen Goals für Score-Berechnungen
- Flexible Goals → automatisch in Platzhaltern verfügbar
- Später umbauen = Doppelarbeit (alle Platzhalter anpassen)

Zukünftige Custom Goals möglich:
- 🧘 Meditation (min/Tag)
- 📅 Trainingshäufigkeit (x/Woche)
- 📊 Planabweichung (%)
- 🎯 Ritual-Adherence (%)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-27 06:45:05 +01:00
..
003_add_email_verification.sql feat: add self-registration with email verification 2026-03-21 09:53:11 +01:00
004_training_types.sql feat(v9d): add training types system + logout button 2026-03-21 13:05:33 +01:00
005_training_types_extended.sql feat: add extended training types (cardio walk/dance, mind & meditation) 2026-03-21 15:16:07 +01:00
006_training_types_abilities.sql feat: admin CRUD for training types + distribution chart in ActivityPage 2026-03-21 15:32:32 +01:00
007_activity_type_mappings.sql feat: learnable activity type mapping system (DB-based, auto-learning) 2026-03-21 19:31:58 +01:00
008_vitals_rest_days.sql feat: add missing migration 008 (vitals, rest days, sleep_goal_minutes) 2026-03-22 10:59:55 +01:00
009_sleep_log.sql fix: migration 009 - change profile_id from VARCHAR(36) to UUID 2026-03-22 08:22:58 +01:00
010_rest_days_jsonb.sql feat: flexible rest days system with JSONB config (v9d Phase 2a) 2026-03-22 16:20:52 +01:00
011_allow_multiple_rest_days_per_date.sql feat: multi-dimensional rest days + development routes architecture (v9d → v9e) 2026-03-22 16:51:09 +01:00
012_rest_days_unique_focus.sql feat: prevent duplicate rest day types per date (Migration 012) 2026-03-22 17:36:49 +01:00
013_training_parameters.sql fix: add missing validation_rules in migration 013 (#15) 2026-03-23 11:01:53 +01:00
014_training_profiles.sql feat: Training Type Profiles - Phase 1.1 Foundation (#15) 2026-03-23 10:49:26 +01:00
014_vitals_extended.sql feat: extend vitals with blood pressure, VO2 max, SpO2, respiratory rate 2026-03-23 15:14:34 +01:00
015_vitals_refactoring.sql refactor: vitals architecture - separate baseline vs blood pressure 2026-03-23 16:02:40 +01:00
016_global_quality_filter.sql feat: global quality filter setting (Issue #31) 2026-03-23 22:29:49 +01:00
017_ai_prompts_flexibilisierung.sql feat: AI-Prompts flexibilisierung - Backend & Admin UI (Issue #28, Part 1) 2026-03-24 15:32:25 +01:00
018_prompt_display_name.sql feat: display_name + placeholder picker for prompts (Issue #28) 2026-03-25 06:31:25 +01:00
019_pipeline_system.sql feat: Pipeline-System - Backend Infrastructure (Issue #28, Phase 1) 2026-03-25 09:42:28 +01:00
020_unified_prompt_system.sql fix: migration 020 - make template column nullable 2026-03-25 14:45:53 +01:00
021_ai_insights_metadata.sql feat: value table + {{placeholder|d}} modifier (Issue #47) 2026-03-26 11:52:26 +01:00
022_goal_system.sql fix: Migration 022 - remove invalid schema_migrations tracking 2026-03-26 16:26:48 +01:00
024_goal_type_registry.sql feat: Phase 1.5 - Flexible Goal System (DB-Registry) Part 1/2 2026-03-27 06:45:05 +01:00
check_features.sql feat: v9c Phase 1 - Feature consolidation & cleanup migration 2026-03-20 18:57:39 +01:00
v9c_cleanup_features.sql feat: v9c Phase 1 - Feature consolidation & cleanup migration 2026-03-20 18:57:39 +01:00
v9c_fix_features.sql fix: add missing feature check endpoint and features 2026-03-20 12:57:29 +01:00
v9c_subscription_system.sql fix: correct UUID foreign key constraints in v9c migration 2026-03-19 12:50:12 +01:00