diff --git a/backend/bloom/services/metrics.py b/backend/bloom/services/metrics.py index b1909d35..7984178a 100644 --- a/backend/bloom/services/metrics.py +++ b/backend/bloom/services/metrics.py @@ -95,8 +95,11 @@ def get_vessels_activity_in_zones( .select_from(sql_model.Metrics) .join( sql_model.Vessel, - sql_model.Metrics.vessel_id == sql_model.Vessel.id, - isouter=True, + sql_model.Metrics.vessel_id == sql_model.Vessel.id + ) + .join( + sql_model.Zone, + sql_model.Metrics.zone_id == sql_model.Zone.id ) .where( sql_model.Metrics.timestamp.between(