diff pkg/models/sr.go @ 3656:2a079d0a71c1

Ensure sounding results are associated to matching bottleneck version
author Tom Gottfried <tom@intevation.de>
date Thu, 13 Jun 2019 19:13:42 +0200
parents 02951a62e8c6
children 07b2df71bb4a
line wrap: on
line diff
--- a/pkg/models/sr.go	Thu Jun 13 11:20:17 2019 +0200
+++ b/pkg/models/sr.go	Thu Jun 13 19:13:42 2019 +0200
@@ -51,7 +51,7 @@
 
 	checkBottleneckDateUniqueSQL = `
 SELECT true FROM waterway.sounding_results sr JOIN
-  waterway.bottlenecks bn ON sr.bottleneck_id = bn.id
+  waterway.bottlenecks bn ON sr.bottleneck_id = bn.bottleneck_id
 WHERE bn.objnam = $1 AND sr.date_info = $2`
 )