Skip to content

Commit

Permalink
Add activity columns: sport_type, trainer
Browse files Browse the repository at this point in the history
  • Loading branch information
liskin committed Nov 2, 2023
1 parent 37d5daf commit 25f22a9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/strava_offline/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
'total_elevation_gain': "REAL",
'gear_id': "TEXT",
'type': "TEXT",
'sport_type': "TEXT",
'commute': "BOOLEAN",
'trainer': "BOOLEAN",
'has_location_data': "BOOLEAN",
},
from_dict=lambda activity: {
Expand All @@ -47,15 +49,17 @@
'total_elevation_gain': activity['total_elevation_gain'],
'gear_id': activity['gear_id'],
'type': activity['type'],
'sport_type': activity.get('sport_type'),
'commute': activity['commute'],
'trainer': activity['trainer'],
'has_location_data': isinstance(activity['start_latlng'], list) and len(activity['start_latlng']) >= 2,
},
)

schema = sqlite.Schema(
# Version of database schema. Bump this whenever the schema changes,
# tables will be recreated using the stored json data and the new schema.
version=3,
version=4,

tables=[
table_bike,
Expand Down

0 comments on commit 25f22a9

Please sign in to comment.