Mercurial > gemma
changeset 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 | 665c4d3fb9a4 |
children | 245e6215361e efb7851f54dd |
files | pkg/imports/st.go |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
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)