aboutsummaryrefslogtreecommitdiff
path: root/db/migrations/20260913000000_ride_official_climb_attempts.sql
blob: 880f81b6b760cda6ff3986750b6cea34e43edf51 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

-- migrate:up
CREATE TABLE ride_official_climb_attempts (
    ride_id integer not null references rides(id),
    climb_id integer not null references official_climbs(id),
    occurrence integer not null,
    distance_m real not null,
    elevation_gain_m real not null,
    slope_percent real not null,
    cotacol real not null,
    cotacol_algo_version text not null,
    started_at text not null,
    ended_at text not null,
    created_at text not null default (strftime('%Y-%m-%dT%H:%M:%SZ', 'now')),
    primary key (ride_id, climb_id, occurrence)
);

-- migrate:down
DROP TABLE ride_official_climb_attempts;