Skip to content

Commit

Permalink
Handle new activity_summary columns, refs #19
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Aug 20, 2021
1 parent 71e36e1 commit 257d40b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions healthkit_to_sqlite/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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):
Expand Down

0 comments on commit 257d40b

Please sign in to comment.