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.
This commit is contained in:
1 parent
a9bd3faabb
commit
894ee1dd02
3 files changed
+52
-32
No files matched your search
@@ -0,0 +1,9 @@
|
||||
-- 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)';
|
||||
Reference in new issue
Block a user