From 257d40bc76e79423c042c2d92942347680b705e8 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Thu, 19 Aug 2021 17:47:13 -0700 Subject: [PATCH] Handle new activity_summary columns, refs #19 --- healthkit_to_sqlite/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/healthkit_to_sqlite/utils.py b/healthkit_to_sqlite/utils.py index fea6bc7..b209ac6 100644 --- a/healthkit_to_sqlite/utils.py +++ b/healthkit_to_sqlite/utils.py @@ -28,7 +28,7 @@ def convert_xml_to_sqlite(fp, db, progress_callback=None, zipfile=None): if tag == "ActivitySummary": activity_summaries.append(dict(el.attrib)) if len(activity_summaries) >= 100: - db["activity_summary"].insert_all(activity_summaries) + db["activity_summary"].insert_all(activity_summaries, alter=True) activity_summaries = [] elif tag == "Workout": workout_to_db(el, db, zipfile) @@ -44,7 +44,7 @@ def convert_xml_to_sqlite(fp, db, progress_callback=None, zipfile=None): if records: write_records(records, db) if activity_summaries: - db["activity_summary"].insert_all(activity_summaries) + db["activity_summary"].insert_all(activity_summaries, alter=True) def workout_to_db(workout, db, zipfile=None):