CREATE TABLE IF NOT EXISTS "schema_migrations" (version varchar(255) primary key); CREATE TABLE rides ( id integer primary key, external_id text unique not null, gpx_path text not null, name text not null, type text not null, start_date text not null, distance_m real 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, moving_time_s integer, moving_time_algo_version text, bike_type TEXT NOT NULL DEFAULT '' CHECK (bike_type IN ('', 'road', 'mtb')), ride_type TEXT NOT NULL DEFAULT '' CHECK (ride_type IN ('', 'training', 'indoor', 'race', 'transport'))); CREATE TABLE official_climbs ( id integer primary key, name text not null, start_latitude real not null, start_longitude real not null, end_latitude real not null, end_longitude 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')) ); CREATE TABLE IF NOT EXISTS "mountain_passes" ( id integer primary key, osm_id integer unique not null, name text, elevation integer, latitude real not null, longitude real not null , category TEXT NOT NULL DEFAULT 'unknown' CHECK (category IN ('road', 'track', 'path', 'hiking', 'unknown'))); -- Dbmate schema migrations INSERT INTO "schema_migrations" (version) VALUES ('20250802140659'), ('20260802090000'), ('20260804000000'), ('20260807000000'), ('20260813000000'), ('20260820184307'), ('20260821000000'), ('20260823000000'), ('20260827000000');