api.log_view
Description
Log web view
Table Definition
CREATE VIEW log_view AS (
SELECT id,
name,
_from AS "from",
_from_time AS started,
_to AS "to",
_to_time AS ended,
distance,
duration,
notes,
api.export_logbook_geojson_trip_fn(id) AS geojson,
avg_speed,
max_speed,
max_wind_speed,
extra,
_from_moorage_id AS from_moorage_id,
_to_moorage_id AS to_moorage_id,
(extra -> 'polar'::text) AS polar,
(user_data -> 'images'::text) AS images,
(user_data -> 'tags'::text) AS tags,
(user_data -> 'observations'::text) AS observations,
CASE
WHEN (jsonb_array_length((user_data -> 'images'::text)) > 0) THEN true
ELSE false
END AS has_images
FROM api.logbook l
WHERE ((_to_time IS NOT NULL) AND (trip IS NOT NULL))
ORDER BY _from_time DESC
)
Columns
| Name | Type | Default | Nullable |
|---|---|---|---|
| avg_speed | double precision | true | |
| distance | numeric | true | |
| duration | interval | true | |
| ended | timestamp with time zone | true | |
| extra | jsonb | true | |
| from | text | true | |
| from_moorage_id | integer | true | |
| geojson | jsonb | true | |
| has_images | boolean | true | |
| id | integer | true | |
| images | jsonb | true | |
| max_speed | double precision | true | |
| max_wind_speed | double precision | true | |
| name | text | true | |
| notes | text | true | |
| observations | jsonb | true | |
| polar | jsonb | true | |
| started | timestamp with time zone | true | |
| tags | jsonb | true | |
| to | text | true | |
| to_moorage_id | integer | true |
Referenced Tables
| Name | Columns | Comment | Type |
|---|---|---|---|
| api.logbook | 42 | Stores generated logbook | BASE TABLE |
Relations
erDiagram
"api.log_view" {
double_precision avg_speed ""
numeric distance ""
interval duration ""
timestamp_with_time_zone ended ""
jsonb extra ""
text from ""
integer from_moorage_id ""
jsonb geojson ""
boolean has_images ""
integer id ""
jsonb images ""
double_precision max_speed ""
double_precision max_wind_speed ""
text name ""
text notes ""
jsonb observations ""
jsonb polar ""
timestamp_with_time_zone started ""
jsonb tags ""
text to ""
integer to_moorage_id ""
}
Generated by tbls