Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

PostgSail

Description

PostgSail database documentation

Tables

NameColumnsCommentType
api.eventlogs_view6Event logs viewVIEW
api.explore_view3explore_view web viewVIEW
api.log_view21Log web viewVIEW
api.log_view321Log web materialized view with RLS appliedVIEW
api.logbook42Stores generated logbookBASE TABLE
api.logs_geojson_view4List logs as geojsonVIEW
api.logs_view11Logs web viewVIEW
api.metadata18Stores metadata received from vessel, aka signalk pluginBASE TABLE
api.metrics11Stores metrics from vesselBASE TABLE
api.monitoring_humidity3Monitoring environment.%.humidity web viewVIEW
api.monitoring_live23Dynamic Monitoring web viewVIEW
api.monitoring_temperatures3Monitoring environment.%.temperature web viewVIEW
api.monitoring_view18Monitoring static web viewVIEW
api.monitoring_view22Monitoring Last whatever data from json web viewVIEW
api.monitoring_view33Monitoring Timeseries whatever data from json web viewVIEW
api.monitoring_voltage3Monitoring electrical.%.voltage web viewVIEW
api.moorage_view18Moorage details web viewVIEW
api.moorages13Stores generated mooragesBASE TABLE
api.moorages_geojson_view3List moorages as geojsonVIEW
api.moorages_stays_view10Moorages stay listing web viewVIEW
api.moorages_view6Moorages listing web viewVIEW
api.stats_logs_view9Statistics Logs web viewVIEW
api.stats_moorages_away_view2Statistics Moorages Time Spent Away web viewVIEW
api.stats_moorages_view4Statistics Moorages web viewVIEW
api.stay_explore_view14List moorages notes order by staysVIEW
api.stay_view18Stay web viewVIEW
api.stays14Stores generated staysBASE TABLE
api.stays_at2Stay TypeBASE TABLE
api.stays_geojson_view1List stays as geojsonVIEW
api.stays_view16Stays web viewVIEW
api.total_info_view3total_info_view web viewVIEW
api.versions_view5Expose as a table view app and system version to APIVIEW
api.vessels_view9Expose vessels listing to web apiVIEW
auth.accounts11users account tableBASE TABLE
auth.otp4Stores temporal otp code for up to 15 minutesBASE TABLE
auth.vessels7vessels table link to accounts email user_id columnBASE TABLE
public.aistypes2aistypes AIS Ship Types, https://api.vesselfinder.com/docs/ref-aistypes.htmlBASE TABLE
public.app_settings2application settingsBASE TABLE
public.badges2Badges descriptionsBASE TABLE
public.email_templates5email/message templates for notificationsBASE TABLE
public.geocoders3geo service nominatim urlBASE TABLE
public.iso31664This is a complete list of all country ISO codes as described in the ISO 3166 international standard. Country Codes Alpha-2 & Alpha-3 https://www.iban.com/country-codesBASE TABLE
public.mid3MMSI MID Codes (Maritime Mobile Service Identity) Filtered by Flag of Registration, https://www.marinevesseltraffic.com/2013/11/mmsi-mid-codes-by-flag.htmlBASE TABLE
public.process_queue6process queue for async jobBASE TABLE

Stored procedures and functions

NameReturnTypeArgumentsType
api.counts_fnjsonbFUNCTION
api.delete_logbook_fnbool_id integerFUNCTION
api.delete_trip_entry_fnvoid_id integer, update_string tstzspanFUNCTION
api.email_fnbooltoken textFUNCTION
api.export_logbook_geojson_linestring_trip_fnjsonb_id integerFUNCTION
api.export_logbook_geojson_point_trip_fnjsonb_id integerFUNCTION
api.export_logbook_geojson_trip_fnjsonb_id integerFUNCTION
api.export_logbook_gpx_trip_fntext/xml_id integerFUNCTION
api.export_logbook_kml_trip_fntext/xml_id integerFUNCTION
api.export_logbook_metrics_trip_fnjsonb_id integerFUNCTION
api.export_logbook_polar_csv_fntext_id integerFUNCTION
api.export_logbooks_geojson_linestring_trips_fnjsonbstart_log integer DEFAULT NULL::integer, end_log integer DEFAULT NULL::integer, start_date text DEFAULT NULL::text, end_date text DEFAULT NULL::text, OUT geojson jsonbFUNCTION
api.export_logbooks_geojson_point_trips_fnjsonbstart_log integer DEFAULT NULL::integer, end_log integer DEFAULT NULL::integer, start_date text DEFAULT NULL::text, end_date text DEFAULT NULL::text, OUT geojson jsonbFUNCTION
api.export_logbooks_gpx_trips_fntext/xmlstart_log integer DEFAULT NULL::integer, end_log integer DEFAULT NULL::integerFUNCTION
api.export_logbooks_kml_trips_fntext/xmlstart_log integer DEFAULT NULL::integer, end_log integer DEFAULT NULL::integerFUNCTION
api.export_moorages_geojson_fnjsonbOUT geojson jsonbFUNCTION
api.export_moorages_gpx_fntext/xmlFUNCTION
api.export_moorages_kml_fntext/xmlFUNCTION
api.export_stays_geojson_fnjsonbOUT geojson jsonbFUNCTION
api.export_vessel_geojson_fnjsonbOUT geojson jsonbFUNCTION
api.find_log_from_moorage_fnjsonb_id integer, OUT geojson jsonbFUNCTION
api.find_log_to_moorage_fnjsonb_id integer, OUT geojson jsonbFUNCTION
api.find_stay_from_moorage_fnvoid_id integerFUNCTION
api.generate_otp_fntextemail textFUNCTION
api.ispublic_fnboolboat text, _type text, _id integer DEFAULT NULL::integerFUNCTION
api.logbook_update_geojson_trip_fnjsonb_id integerFUNCTION
api.loginjwt_tokenemail text, pass textFUNCTION
api.logs_by_day_fnjsonbOUT charts jsonbFUNCTION
api.logs_by_month_fnjsonbOUT charts jsonbFUNCTION
api.merge_logbook_fnvoidid_start integer, id_end integerFUNCTION
api.monitoring_history_fnjsonbtime_interval text DEFAULT ‘24’::text, OUT history_metrics jsonbFUNCTION
api.pushover_fnbooltoken text, pushover_user_key textFUNCTION
api.pushover_subscribe_link_fnjsonOUT pushover_link jsonFUNCTION
api.recoverboolemail textFUNCTION
api.register_vesseljwt_tokenvessel_email text, vessel_mmsi text, vessel_name textFUNCTION
api.resetboolpass text, token text, uuid textFUNCTION
api.settings_fnjsonOUT settings jsonFUNCTION
api.signupjwt_tokenemail text, pass text, firstname text, lastname textFUNCTION
api.stats_fnjsonbstart_date text DEFAULT NULL::text, end_date text DEFAULT NULL::text, OUT stats jsonbFUNCTION
api.stats_logs_fnjsonbstart_date text DEFAULT NULL::text, end_date text DEFAULT NULL::text, OUT stats jsonbFUNCTION
api.stats_stays_fnjsonstart_date text DEFAULT NULL::text, end_date text DEFAULT NULL::text, OUT stats jsonFUNCTION
api.status_fnjsonbOUT status jsonbFUNCTION
api.telegramjwt_tokenuser_id bigint, email text DEFAULT NULL::textFUNCTION
api.telegram_fnbooltoken text, telegram_obj textFUNCTION
api.telegram_otp_fntextemail text, OUT otp_code textFUNCTION
api.update_logbook_observations_fnbool_id integer, observations textFUNCTION
api.update_metadata_userdata_fnbooluserdata textFUNCTION
api.update_trip_notes_fnvoid_id integer, update_string ttextFUNCTION
api.update_user_preferences_fnboolkey text, value textFUNCTION
api.versions_fnjsonFUNCTION
api.vessel_details_fnjsonbFUNCTION
api.vessel_extended_fnjsonbFUNCTION
api.vessel_fnjsonbOUT vessel jsonbFUNCTION
auth.check_role_existstriggerFUNCTION
auth.encrypt_passtriggerFUNCTION
auth.telegram_session_exists_fnbooluser_id bigintFUNCTION
auth.telegram_user_exists_fnboolemail text, user_id bigintFUNCTION
auth.user_rolenameemail text, pass textFUNCTION
auth.verify_otp_fntexttoken textFUNCTION
public.autodiscovery_config_fnjsonbinput_json jsonbFUNCTION
public.badges_geom_fnvoidlogbook_id integer, logbook_time textFUNCTION
public.badges_logbook_fnvoidlogbook_id integer, logbook_time textFUNCTION
public.badges_moorages_fnvoidFUNCTION
public.cron_alerts_fnvoidFUNCTION
public.cron_process_autodiscovery_fnvoidFUNCTION
public.cron_process_grafana_fnvoidFUNCTION
public.cron_process_monitor_offline_fnvoidFUNCTION
public.cron_process_monitor_online_fnvoidFUNCTION
public.cron_process_new_logbook_fnvoidFUNCTION
public.cron_process_new_notification_fnvoidFUNCTION
public.cron_process_new_stay_fnvoidFUNCTION
public.cron_process_post_logbook_fnvoidFUNCTION
public.cron_process_pre_logbook_fnvoidFUNCTION
public.cron_prune_otp_fnvoidFUNCTION
public.cron_windy_fnvoidFUNCTION
public.debug_trigger_fntriggerFUNCTION
public.delete_vessel_fnjsonb_vessel_id textFUNCTION
public.dump_account_fnbool_email text, _vessel_id textFUNCTION
public.export_logbook_polar_fnrecord_id integerFUNCTION
public.generate_uid_fntextsize integerFUNCTION
public.geojson_py_fnjsonboriginal jsonb, geometry_type textFUNCTION
public.get_app_settings_fnjsonbOUT app_settings jsonbFUNCTION
public.get_app_url_fnjsonbOUT app_settings jsonbFUNCTION
public.get_user_settings_from_vesselid_fnjsonbvesselid text, OUT user_settings jsonbFUNCTION
public.grafana_py_fnvoid_v_name text, _v_id text, _u_email text, app jsonbFUNCTION
public.has_vessel_fnboolFUNCTION
public.has_vessel_metadata_fnboolFUNCTION
public.logbook_active_geojson_fnjsonbOUT _track_geojson jsonbFUNCTION
public.logbook_completed_trigger_fntriggerFUNCTION
public.logbook_delete_trigger_fntriggerFUNCTION
public.logbook_get_extra_json_fnjsonsearch text, OUT output_json jsonFUNCTION
public.logbook_metrics_dwithin_fnnumeric_start text, _end text, lgn double precision, lat double precision, OUT count_metric numericFUNCTION
public.logbook_metrics_timebucket_fnboolbucket_interval text, _id integer, _start timestamp with time zone, _end timestamp with time zone, OUT timebucket booleanFUNCTION
public.logbook_timelapse_geojson_fnvoid_id integerFUNCTION
public.logbook_update_avg_fnrecord_id integer, _start text, _end text, OUT avg_speed double precision, OUT max_speed double precision, OUT max_wind_speed double precision, OUT avg_wind_speed double precision, OUT count_metric integerFUNCTION
public.logbook_update_extra_json_fnjson_id integer, _start text, _end text, OUT _extra_json jsonFUNCTION
public.logbook_update_geojson_fnjson_id integer, _start text, _end text, OUT _track_geojson jsonFUNCTION
public.logbook_update_geom_distance_fnrecord_id integer, _start text, _end text, OUT _track_geom geometry, OUT _track_distance double precisionFUNCTION
public.logbook_update_gpx_fnxml_id integer, _start text, _end text, OUT _track_gpx xmlFUNCTION
public.logbook_update_metrics_short_fnrecordtotal_entry integer, start_date timestamp with time zone, end_date timestamp with time zoneFUNCTION
public.logbook_update_metrics_timebucket_fnrecordtotal_entry integer, start_date timestamp with time zone, end_date timestamp with time zoneFUNCTION
public.metadata_autodiscovery_trigger_fntriggerFUNCTION
public.metadata_grafana_trigger_fntriggerFUNCTION
public.metadata_upsert_trigger_fntriggerFUNCTION
public.metrics_trigger_fntriggerFUNCTION
public.moorage_delete_trigger_fntriggerFUNCTION
public.moorage_update_trigger_fntriggerFUNCTION
public.new_account_entry_fntriggerFUNCTION
public.new_account_otp_validation_entry_fntriggerFUNCTION
public.new_vessel_entry_fntriggerFUNCTION
public.new_vessel_public_fntriggerFUNCTION
public.new_vessel_trim_fntriggerFUNCTION
public.overpass_py_fnjsonblon numeric, lat numeric, retry boolean DEFAULT false, OUT geo jsonbFUNCTION
public.process_account_otp_validation_queue_fnvoid_email textFUNCTION
public.process_account_queue_fnvoid_email textFUNCTION
public.process_lat_lon_fnrecordlon numeric, lat numeric, OUT moorage_id integer, OUT moorage_type integer, OUT moorage_name text, OUT moorage_country textFUNCTION
public.process_logbook_queue_fnvoid_id integerFUNCTION
public.process_moorage_queue_fnvoid_id integerFUNCTION
public.process_notification_queue_fnvoid_email text, message_type textFUNCTION
public.process_post_logbook_fnvoid_id integerFUNCTION
public.process_pre_logbook_fnvoid_id integerFUNCTION
public.process_stay_queue_fnvoid_id integerFUNCTION
public.process_vessel_queue_fnvoid_email textFUNCTION
public.reverse_geocode_py_fnjsonbgeocoder text, lon numeric, lat numeric, OUT geo jsonbFUNCTION
public.reverse_geoip_py_fnjsonb_ip textFUNCTION
public.send_email_py_fnvoidemail_type text, _user jsonb, app jsonbFUNCTION
public.send_notification_fnvoidemail_type text, user_settings jsonbFUNCTION
public.send_pushover_py_fnvoidmessage_type text, _user jsonb, app jsonbFUNCTION
public.send_telegram_py_fnvoidmessage_type text, _user jsonb, app jsonbFUNCTION
public.set_vessel_settings_from_vesselid_fnjsonbvesselid text, OUT vessel_settings jsonbFUNCTION
public.split_logbook_by24h_fnrecord_id integerFUNCTION
public.split_logbook_by24h_geojson_fnjsonb_id integerFUNCTION
public.stay_active_geojson_fnjsonb_time timestamp with time zone DEFAULT now(), OUT _track_geojson jsonbFUNCTION
public.stay_completed_trigger_fntriggerFUNCTION
public.stay_delete_trigger_fntriggerFUNCTION
public.stay_in_progress_fnint4_vessel_id textFUNCTION
public.trip_in_progress_fnint4_vessel_id textFUNCTION
public.update_logbook_with_geojson_trigger_fntriggerFUNCTION
public.update_metadata_configuration_trigger_fntriggerFUNCTION
public.update_metadata_userdata_added_at_trigger_fntriggerFUNCTION
public.update_tbl_userdata_added_at_trigger_fntriggerFUNCTION
public.urlencode_py_fntexturi textFUNCTION
public.urlescape_py_fntextoriginal textFUNCTION
public.windy_pws_py_fnjsonbmetric jsonb, _user jsonb, app jsonbFUNCTION

Enums

NameValues
public.public_typepublic_logs, public_logs_list, public_monitoring, public_stats, public_timelapse
public.status_typeanchored, moored, motoring, sailing

Relations

erDiagram

"api.logbook" }o--|| "api.metadata" : "FOREIGN KEY (vessel_id) REFERENCES api.metadata(vessel_id) ON DELETE RESTRICT"
"api.logbook" }o--o| "api.moorages" : "FOREIGN KEY (_from_moorage_id) REFERENCES api.moorages(id) ON DELETE RESTRICT"
"api.logbook" }o--o| "api.moorages" : "FOREIGN KEY (_to_moorage_id) REFERENCES api.moorages(id) ON DELETE RESTRICT"
"api.metadata" |o--|| "auth.vessels" : "FOREIGN KEY (vessel_id) REFERENCES auth.vessels(vessel_id) ON DELETE RESTRICT"
"api.metrics" }o--|| "api.metadata" : "FOREIGN KEY (vessel_id) REFERENCES api.metadata(vessel_id) ON DELETE RESTRICT"
"api.moorages" }o--|| "api.metadata" : "FOREIGN KEY (vessel_id) REFERENCES api.metadata(vessel_id) ON DELETE RESTRICT"
"api.moorages" }o--o| "api.stays_at" : "FOREIGN KEY (stay_code) REFERENCES api.stays_at(stay_code) ON DELETE RESTRICT"
"api.stays" }o--|| "api.metadata" : "FOREIGN KEY (vessel_id) REFERENCES api.metadata(vessel_id) ON DELETE RESTRICT"
"api.stays" }o--o| "api.moorages" : "FOREIGN KEY (moorage_id) REFERENCES api.moorages(id) ON DELETE RESTRICT"
"api.stays" }o--o| "api.stays_at" : "FOREIGN KEY (stay_code) REFERENCES api.stays_at(stay_code) ON DELETE RESTRICT"
"auth.otp" |o--|| "auth.accounts" : "FOREIGN KEY (user_email) REFERENCES auth.accounts(email) ON DELETE RESTRICT"
"auth.vessels" }o--|| "auth.accounts" : "FOREIGN KEY (owner_email) REFERENCES auth.accounts(email) ON DELETE RESTRICT"

"api.eventlogs_view" {
  text channel ""
  integer id ""
  text payload ""
  timestamp_with_time_zone processed ""
  text ref_id ""
  timestamp_with_time_zone stored ""
}
"api.explore_view" {
  text key ""
  timestamp_with_time_zone time ""
  text value ""
}
"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 ""
}
"api.log_view3" {
  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 ""
}
"api.logbook" {
  text _from "Name of the location where the log started, usually a moorage name"
  double_precision _from_lat ""
  double_precision _from_lng ""
  integer _from_moorage_id FK "Link api.moorages with api.logbook via FOREIGN KEY and REFERENCES"
  timestamp_with_time_zone _from_time ""
  text _to "Name of the location where the log ended, usually a moorage name"
  double_precision _to_lat ""
  double_precision _to_lng ""
  integer _to_moorage_id FK "Link api.moorages with api.logbook via FOREIGN KEY and REFERENCES"
  timestamp_with_time_zone _to_time ""
  boolean active ""
  double_precision avg_speed "avg speed in knots"
  numeric distance "Distance in Nautical Miles converted mobilitydb meters to NM"
  interval duration "Duration in ISO 8601 format"
  jsonb extra "Computed SignalK metrics such as runtime, current level, etc."
  integer id ""
  double_precision max_speed "max speed in knots"
  double_precision max_wind_speed "true wind speed converted in knots, m/s from signalk plugin"
  text name ""
  text notes ""
  tgeogpoint trip "MobilityDB trajectory, speed in m/s, distance in meters"
  tfloat trip_awa "AWA (Apparent Wind Angle) in degrees converted from radians by signalk plugin"
  tfloat trip_aws "AWS (Apparent Wind Speed), windSpeedApparent in knots converted by signalk plugin"
  tfloat trip_batt_charge "Battery Charge"
  tfloat trip_batt_voltage "Battery Voltage"
  tfloat trip_cog "COG - Course Over Ground True in degrees converted from radians by signalk plugin"
  tfloat trip_depth "Depth in meters, raw from signalk plugin"
  tfloat trip_heading "Heading True in degrees converted from radians, raw from signalk plugin"
  tfloat trip_hum_out "Humidity outside"
  ttext trip_notes ""
  tfloat trip_pres_out "Pressure outside"
  tfloat trip_sog "SOG - Speed Over Ground in knots converted by signalk plugin"
  tfloat trip_solar_power "solar powerPanel"
  tfloat trip_solar_voltage "solar voltage"
  ttext trip_status ""
  tfloat trip_tank_level "Tank currentLevel"
  tfloat trip_temp_out "Temperature outside in Kelvin, raw from signalk plugin"
  tfloat trip_temp_water "Temperature water in Kelvin, raw from signalk plugin"
  tfloat trip_twd "TWD - True Wind Direction in degrees converted from radians, raw from signalk plugin"
  tfloat trip_tws "TWS - True Wind Speed in knots converted from m/s, raw from signalk plugin"
  jsonb user_data "User-defined data Log-specific data including actual tags, observations, images and custom fields"
  text vessel_id FK "Unique identifier for the vessel associated with the api.metadata entry"
}
"api.logs_geojson_view" {
  jsonb geojson ""
  integer id ""
  text name ""
  timestamp_with_time_zone starttimestamp ""
}
"api.logs_view" {
  integer _from_moorage_id ""
  integer _to_moorage_id ""
  numeric distance ""
  interval duration ""
  timestamp_with_time_zone ended ""
  text from ""
  integer id ""
  text name ""
  timestamp_with_time_zone started ""
  jsonb tags ""
  text to ""
}
"api.metadata" {
  boolean active "trigger monitor online/offline"
  jsonb available_keys "Signalk paths with unit for custom mapping"
  double_precision beam ""
  jsonb configuration "User-defined Signalk path mapping for metrics"
  timestamp_with_time_zone created_at ""
  double_precision height ""
  text ip "Store vessel ip address"
  double_precision length ""
  text mmsi "Maritime Mobile Service Identity (MMSI) number associated with the vessel, link to public.mid"
  text name ""
  text platform ""
  text plugin_version ""
  numeric ship_type "Type of ship associated with the vessel, link to public.aistypes"
  text signalk_version ""
  timestamp_with_time_zone time ""
  timestamp_with_time_zone updated_at ""
  jsonb user_data "User-defined data including vessel polar (theoretical performance), make/model, and preferences"
  text vessel_id FK "Link auth.vessels with api.metadata via FOREIGN KEY and REFERENCES"
}
"api.metrics" {
  double_precision anglespeedapparent ""
  text client_id "Deprecated client_id to be removed"
  double_precision courseovergroundtrue ""
  double_precision latitude "With CONSTRAINT but allow NULL value to be ignored silently by trigger"
  double_precision longitude "With CONSTRAINT but allow NULL value to be ignored silently by trigger"
  jsonb metrics ""
  double_precision speedoverground ""
  text status ""
  timestamp_with_time_zone time ""
  text vessel_id FK "Unique identifier for the vessel associated with the api.metadata entry"
  double_precision windspeedapparent ""
}
"api.monitoring_humidity" {
  text key ""
  timestamp_with_time_zone time ""
  text value ""
}
"api.monitoring_live" {
  double_precision batterycharge ""
  double_precision batteryvoltage ""
  jsonb data ""
  double_precision depth ""
  jsonb geojson ""
  double_precision insidehumidity ""
  double_precision insidepressure ""
  double_precision insidetemperature ""
  jsonb live ""
  text name ""
  boolean offline ""
  double_precision outsidehumidity ""
  double_precision outsidepressure ""
  json outsidepressurehistory ""
  double_precision outsidetemperature ""
  double_precision solarpower ""
  double_precision solarvoltage ""
  text status ""
  double_precision tanklevel ""
  timestamp_with_time_zone time ""
  double_precision watertemperature ""
  double_precision winddirectiontrue ""
  double_precision windspeedoverground ""
}
"api.monitoring_temperatures" {
  text key ""
  timestamp_with_time_zone time ""
  text value ""
}
"api.monitoring_view" {
  jsonb batterycharge ""
  jsonb batteryvoltage ""
  jsonb depth ""
  jsonb geojson ""
  jsonb insidehumidity ""
  jsonb insidepressure ""
  jsonb insidetemperature ""
  jsonb live ""
  text name ""
  boolean offline ""
  jsonb outsidehumidity ""
  jsonb outsidepressure ""
  jsonb outsidetemperature ""
  text status ""
  timestamp_with_time_zone time ""
  jsonb watertemperature ""
  jsonb winddirectiontrue ""
  jsonb windspeedoverground ""
}
"api.monitoring_view2" {
  text key ""
  jsonb value ""
}
"api.monitoring_view3" {
  text key ""
  timestamp_with_time_zone time ""
  text value ""
}
"api.monitoring_voltage" {
  text key ""
  timestamp_with_time_zone time ""
  text value ""
}
"api.moorage_view" {
  text default_stay ""
  integer default_stay_id ""
  geography_Point_4326_ geog ""
  boolean has_images ""
  boolean home ""
  integer id ""
  jsonb images ""
  double_precision latitude ""
  bigint logs_count ""
  double_precision longitude ""
  text name ""
  text notes ""
  timestamp_with_time_zone stay_first_seen ""
  integer stay_first_seen_id ""
  timestamp_with_time_zone stay_last_seen ""
  integer stay_last_seen_id ""
  bigint stays_count ""
  interval stays_sum_duration ""
}
"api.moorages" {
  text country ""
  geography_Point_4326_ geog "postgis geography type default SRID 4326 Unit: degres"
  boolean home_flag ""
  integer id ""
  double_precision latitude ""
  double_precision longitude ""
  text name ""
  jsonb nominatim "Output of the nominatim reverse geocoding service, see https://nominatim.org/release-docs/develop/api/Reverse/"
  text notes ""
  jsonb overpass "Output of the overpass API, see https://wiki.openstreetmap.org/wiki/Overpass_API"
  integer stay_code FK "Link api.stays_at with api.moorages via FOREIGN KEY and REFERENCES"
  jsonb user_data "User-defined data Mooring-specific data including images and custom fields"
  text vessel_id FK "Unique identifier for the vessel associated with the api.metadata entry"
}
"api.moorages_geojson_view" {
  jsonb geojson ""
  integer id ""
  text name ""
}
"api.moorages_stays_view" {
  integer _from_id ""
  text _from_name ""
  timestamp_with_time_zone _from_time ""
  integer _to_id ""
  text _to_name ""
  timestamp_with_time_zone _to_time ""
  interval duration ""
  integer id ""
  text name ""
  integer stay_code ""
}
"api.moorages_view" {
  bigint arrivals_departures ""
  text default_stay ""
  integer default_stay_id ""
  integer id ""
  text moorage ""
  interval total_duration ""
}
"api.stats_logs_view" {
  timestamp_with_time_zone first ""
  timestamp_with_time_zone last ""
  text longest_nonstop_sail ""
  double_precision max_speed ""
  double_precision max_wind_speed ""
  text name ""
  bigint number_of_log_entries ""
  numeric total_distance ""
  interval total_time_underway ""
}
"api.stats_moorages_away_view" {
  text description ""
  interval time_spent_away_by ""
}
"api.stats_moorages_view" {
  bigint home_ports ""
  interval time_spent_at_home_port(s) ""
  interval time_spent_away ""
  bigint unique_moorages ""
}
"api.stay_explore_view" {
  timestamp_with_time_zone arrived ""
  boolean has_images ""
  integer id ""
  jsonb images ""
  double_precision latitude ""
  double_precision longitude ""
  integer moorage_id ""
  text moorage_name ""
  text moorage_notes ""
  text name ""
  integer stay_code ""
  integer stay_id ""
  text stay_name ""
  text stay_notes ""
}
"api.stay_view" {
  timestamp_with_time_zone arrived ""
  integer arrived_from_moorage_id ""
  text arrived_from_moorage_name ""
  integer arrived_log_id ""
  timestamp_with_time_zone departed ""
  integer departed_log_id ""
  integer departed_to_moorage_id ""
  text departed_to_moorage_name ""
  interval duration ""
  boolean has_images ""
  integer id ""
  jsonb images ""
  text moorage ""
  integer moorage_id ""
  text name ""
  text notes ""
  text stayed_at ""
  integer stayed_at_id ""
}
"api.stays" {
  boolean active ""
  timestamp_with_time_zone arrived ""
  timestamp_with_time_zone departed ""
  interval duration "Best to use standard ISO 8601"
  geography_Point_4326_ geog "postgis geography type default SRID 4326 Unit: degres"
  integer id ""
  double_precision latitude ""
  double_precision longitude ""
  integer moorage_id FK "Link api.moorages with api.stays via FOREIGN KEY and REFERENCES"
  text name ""
  text notes ""
  integer stay_code FK "Link api.stays_at with api.stays via FOREIGN KEY and REFERENCES"
  jsonb user_data "User-defined data Stay-specific data including images and custom fields"
  text vessel_id FK "Unique identifier for the vessel associated with the api.metadata entry"
}
"api.stays_at" {
  text description ""
  integer stay_code ""
}
"api.stays_geojson_view" {
  jsonb geojson ""
}
"api.stays_view" {
  timestamp_with_time_zone arrived ""
  integer arrived_from_moorage_id ""
  text arrived_from_moorage_name ""
  integer arrived_log_id ""
  timestamp_with_time_zone departed ""
  integer departed_log_id ""
  integer departed_to_moorage_id ""
  text departed_to_moorage_name ""
  interval duration ""
  integer id ""
  text moorage ""
  integer moorage_id ""
  text name ""
  text notes ""
  text stayed_at ""
  integer stayed_at_id ""
}
"api.total_info_view" {
  bigint logs ""
  bigint moorages ""
  bigint stays ""
}
"api.versions_view" {
  text api_version ""
  text postgis ""
  text postgrest ""
  text sys_version ""
  text timescaledb ""
}
"api.vessels_view" {
  timestamp_with_time_zone created_at ""
  interval duration ""
  interval duration_last_metrics ""
  text last_contact ""
  text last_metrics ""
  boolean metrics_offline ""
  numeric mmsi ""
  text name ""
  boolean offline ""
}
"auth.accounts" {
  timestamp_with_time_zone connected_at ""
  timestamp_with_time_zone created_at ""
  citext email ""
  text first "User first name with CONSTRAINT CHECK"
  integer id ""
  text last "User last name with CONSTRAINT CHECK"
  text pass ""
  jsonb preferences ""
  name role ""
  timestamp_with_time_zone updated_at ""
  text user_id ""
}
"auth.otp" {
  text otp_pass ""
  timestamp_with_time_zone otp_timestamp ""
  smallint otp_tries ""
  citext user_email FK ""
}
"auth.vessels" {
  timestamp_with_time_zone created_at ""
  numeric mmsi "MMSI can be optional but if present must be a valid one and unique but must be in numeric range between 100000000 and 800000000"
  text name ""
  citext owner_email FK ""
  name role ""
  timestamp_with_time_zone updated_at ""
  text vessel_id ""
}
"public.aistypes" {
  text description ""
  numeric id ""
}
"public.app_settings" {
  text name "application settings name key"
  text value "application settings value"
}
"public.badges" {
  text description ""
  text name ""
}
"public.email_templates" {
  text email_content ""
  text email_subject ""
  text name ""
  text pushover_message ""
  text pushover_title ""
}
"public.geocoders" {
  text name ""
  text reverse_url ""
  text url ""
}
"public.iso3166" {
  text alpha_2 ""
  text alpha_3 ""
  text country ""
  integer id ""
}
"public.mid" {
  text country ""
  integer country_id ""
  numeric id ""
}
"public.process_queue" {
  text channel ""
  integer id ""
  text payload ""
  timestamp_with_time_zone processed ""
  text ref_id "either user_id or vessel_id"
  timestamp_with_time_zone stored ""
}

Generated by tbls