Skip to content

Commit 9980f6e

Browse files
authored
fix(queries): Correct join in ListPredictions (#77)
1 parent 2e2d4f9 commit 9980f6e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

internal/server/postgres/sql/queries/predictions.sql

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,10 @@ SELECT
165165
)::REAL AS capacity_inc_limit,
166166
sv.capacity,
167167
sv.capacity_unit_prefix_factor
168-
FROM pred.predicted_generation_values AS pg
168+
FROM pred.forecasts AS f
169+
INNER JOIN pred.predicted_generation_values AS pg USING (forecast_uuid)
169170
INNER JOIN loc.sources_mv AS sv USING (geometry_uuid, source_type_id)
170-
WHERE pg.forecast_uuid = $1
171+
WHERE f.forecast_uuid = $1
171172
AND sv.sys_period @> pg.target_time_utc;
172173

173174
-- name: ListPredictionsForLocation :many

0 commit comments

Comments
 (0)