- 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.
10 lines
473 B
SQL
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)';
|