# HG changeset patch # User Tom Gottfried # Date 1570210168 -7200 # Node ID aeb2aedd3abd00cd41cbd3cc3b56faa2f922c46d # Parent 665c4d3fb9a48debd41c41d4a20370f97c4c9fb0 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. diff -r 665c4d3fb9a4 -r aeb2aedd3abd pkg/imports/st.go --- 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)