diff pkg/imports/st.go @ 4520:aeb2aedd3abd

Fix deletion of stretches on import More than one stretch can be imported at once using shapefile upload. Deletion of multiple superseeded stretches failed on acceptance of the import due to subqueries returning more than one entry.
author Tom Gottfried <tom@intevation.de>
date Fri, 04 Oct 2019 19:29:28 +0200
parents 5e38667f740c
children 59a99655f34d
line wrap: on
line diff
--- a/pkg/imports/st.go	Fri Oct 04 17:53:47 2019 +0200
+++ b/pkg/imports/st.go	Fri Oct 04 19:29:28 2019 +0200
@@ -58,10 +58,10 @@
 const (
 	stDeleteSQL = `
 DELETE FROM users.stretches WHERE
-staging_done AND name = (
+staging_done AND name IN (
   SELECT name
   FROM users.stretches WHERE
-  id = (
+  id IN (
     SELECT key from import.track_imports
     WHERE import_id = $1 AND
       relation = 'users.stretches'::regclass)