Skip to content

Commit 8231ce1

Browse files
update geom for projects only if import info.kml exists
1 parent 465e425 commit 8231ce1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

postgres/scripts/v1_to_v2/copy_projects_from_csv.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ WHERE v1_projects.import_id = v1_imports.import_id;
5656

5757
-- Convert geometry to postgis geometry type.
5858
UPDATE v1_projects
59-
SET geom = ST_Force2D(ST_Multi(ST_GeomFromKML(kml)));
59+
SET geom = ST_Force2D(ST_Multi(ST_GeomFromKML(kml)))
60+
WHERE kml IS NOT NULL;
6061

6162
-- Insert or update data of temp table to the permant table (projects)
6263
-- Note that the special excluded table is used to reference values originally proposed for insertion

0 commit comments

Comments
 (0)