mitai-jinkendo/backend/migrations/051_blood_pressure_source_csv.sql
Lars 894ee1dd02
All checks were successful
Deploy Development / deploy (push) Successful in 48s
Build Test / pytest-backend (push) Successful in 4s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 16s
refactor(csv_parser): Update training type resolution to use existing database cursor
- Modified `_resolve_training_type_for_activity` to accept a database cursor, improving efficiency and avoiding potential deadlocks during CSV imports.
- Introduced `get_training_type_for_activity_with_cursor` to handle training type resolution with an existing cursor, streamlining database interactions.
- Updated related calls in the activity import logic to utilize the new function, ensuring consistent behavior across the application.
2026-04-11 06:27:11 +02:00

10 lines
473 B
SQL

-- Universal-CSV-Import schreibt source = 'csv' (siehe csv_parser/executor _import_blood_pressure).
ALTER TABLE blood_pressure_log DROP CONSTRAINT IF EXISTS blood_pressure_log_source_check;
ALTER TABLE blood_pressure_log ADD CONSTRAINT blood_pressure_log_source_check
CHECK (source IN ('manual', 'omron', 'apple_health', 'withings', 'csv'));
COMMENT ON COLUMN blood_pressure_log.source IS
'manual | omron | apple_health | withings | csv (Universal-CSV-Import)';