Update migration 202412

- Update api.export_logbook_geojson_point_trip_fn, fix dynamic notes
This commit is contained in:
xbgmsharp
2025-01-08 23:30:44 +01:00
parent aa7608e07e
commit 1b57641e7d

View File

@@ -880,7 +880,7 @@ BEGIN
metrics_geojson, metrics_geojson,
'{1, properties}', '{1, properties}',
CASE CASE
WHEN (metrics_geojson->1->'properties'->>'notes') IS NULL THEN -- it is not null but empty?? WHEN (metrics_geojson->1->'properties'->>'notes') IS "" THEN -- it is not null but empty??
(metrics_geojson->1->'properties' || second_feature_note)::jsonb (metrics_geojson->1->'properties' || second_feature_note)::jsonb
ELSE ELSE
metrics_geojson->1->'properties' metrics_geojson->1->'properties'
@@ -892,7 +892,7 @@ BEGIN
metrics_geojson, metrics_geojson,
'{-1, properties}', '{-1, properties}',
CASE CASE
WHEN (metrics_geojson->-1->'properties'->>'notes') IS NULL THEN -- it is not null but empty?? WHEN (metrics_geojson->-1->'properties'->>'notes') IS "" THEN -- it is not null but empty??
(metrics_geojson->-1->'properties' || last_feature_note)::jsonb (metrics_geojson->-1->'properties' || last_feature_note)::jsonb
ELSE ELSE
metrics_geojson->-1->'properties' metrics_geojson->-1->'properties'
@@ -2095,8 +2095,9 @@ GRANT EXECUTE ON FUNCTION api.export_logbooks_geojson_point_trips_fn to api_anon
--GRANT EXECUTE ON FUNCTION api.logbook_update_geojson_trip_fn to api_anonymous; --GRANT EXECUTE ON FUNCTION api.logbook_update_geojson_trip_fn to api_anonymous;
GRANT EXECUTE ON FUNCTION api.export_logbook_geojson_trip_fn to api_anonymous; GRANT EXECUTE ON FUNCTION api.export_logbook_geojson_trip_fn to api_anonymous;
GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA public TO api_anonymous; GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA public TO api_anonymous;
GRANT SELECT ON TABLE api.moorage_view TO grafana; GRANT SELECT ON TABLE api.log_view TO grafana;
GRANT SELECT ON TABLE api.moorages_view TO grafana; GRANT SELECT ON TABLE api.moorages_view TO grafana;
GRANT SELECT ON TABLE api.moorage_view TO grafana;
GRANT SELECT ON ALL TABLES IN SCHEMA api TO user_role; GRANT SELECT ON ALL TABLES IN SCHEMA api TO user_role;
GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA api TO user_role; GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA api TO user_role;
GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA public TO user_role; GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA public TO user_role;