deckgl_tracksolid/db
David Kiania b0db22c669 feat(db): surface upstream trips enrichment columns in PostgREST RPCs
Adds migrations 006/007/008 that wrap tracksolid.v_trips_enriched
(introduced upstream in tracksolid_timescale_grafana_prod migration 09)
and DROP+CREATE the trips_for_day / trips_for_range RPCs to return the
new metadata columns: vehicle_plate, start_address, end_address,
driving_time_s, idle_time_s, fuel_consumed_l, and daily_seq.

Path/timestamps logic is unchanged — position_history is still scanned
to produce the per-vertex timestamps_rel that drive deck.gl TripsLayer
animation. route_geom can't replace this since it carries no per-vertex
time, but the GIST index on it is available for future area filters.

Day filter switches from start_time::date to v.trip_date_eat (the
Africa/Nairobi local date already computed by v_trips_enriched), which
fixes the latent bug where trips spanning midnight UTC could be
misbucketed.

Frontend Trip type still receives all original fields in compatible
positions; the new fields are additive and ignored by the existing
TripsLayer code.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-02 11:09:55 +03:00
..
migrations feat(db): surface upstream trips enrichment columns in PostgREST RPCs 2026-05-02 11:09:55 +03:00