aboutsummaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2026-08-21 06:56:12 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2026-08-21 06:56:12 +0200
commit9da52d7355f5a77f0adc9a658619b3bfef03ba3c (patch)
treeb9e5f803d0c9787a84696b9e38b06b6721c9ded3 /db
parent13aeedfbb9271444ca42efb45bbe0986ae7610ce (diff)
feat(ride): persist canonical moving time, preserve Strava reference
Diffstat (limited to 'db')
-rw-r--r--db/migrations/20260820184307_ride_moving_time.sql9
-rw-r--r--db/schema.sql7
2 files changed, 13 insertions, 3 deletions
diff --git a/db/migrations/20260820184307_ride_moving_time.sql b/db/migrations/20260820184307_ride_moving_time.sql
new file mode 100644
index 0000000..6505609
--- /dev/null
+++ b/db/migrations/20260820184307_ride_moving_time.sql
@@ -0,0 +1,9 @@
+-- migrate:up
+alter table rides rename column moving_time_s to external_moving_time_s;
+alter table rides add column moving_time_s integer;
+alter table rides add column moving_time_algo_version text;
+
+-- migrate:down
+alter table rides drop column moving_time_algo_version;
+alter table rides drop column moving_time_s;
+alter table rides rename column external_moving_time_s to moving_time_s; \ No newline at end of file
diff --git a/db/schema.sql b/db/schema.sql
index 6c8f8ac..4c03183 100644
--- a/db/schema.sql
+++ b/db/schema.sql
@@ -23,13 +23,13 @@ CREATE TABLE rides (
type text not null,
start_date text not null,
distance_m real not null,
- moving_time_s integer not null,
+ external_moving_time_s integer not null,
elapsed_time_s integer not null,
total_elevation_gain_m real not null,
average_speed_mps real not null,
created_at text not null default (strftime('%Y-%m-%dT%H:%M:%SZ', 'now')),
updated_at text not null default (strftime('%Y-%m-%dT%H:%M:%SZ', 'now'))
-, cotacol_score real, cotacol_algo_version text);
+, cotacol_score real, cotacol_algo_version text, moving_time_s integer, moving_time_algo_version text);
CREATE TABLE official_climbs (
id integer primary key,
name text not null,
@@ -46,4 +46,5 @@ INSERT INTO "schema_migrations" (version) VALUES
('20260802090000'),
('20260804000000'),
('20260807000000'),
- ('20260813000000');
+ ('20260813000000'),
+ ('20260820184307');