changeset 1663:10e3dd3b9363

Fairway availability import: Don't use tabs in SQL statements.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Sun, 23 Dec 2018 12:51:51 +0100
parents d8ca44615bfc
children 819f67c31dfb
files pkg/imports/fa.go
diffstat 1 files changed, 53 insertions(+), 52 deletions(-) [+]
line wrap: on
line diff
--- a/pkg/imports/fa.go	Fri Dec 21 15:56:28 2018 +0100
+++ b/pkg/imports/fa.go	Sun Dec 23 12:51:51 2018 +0100
@@ -18,10 +18,11 @@
 	"errors"
 	"time"
 
+	"github.com/jackc/pgx/pgtype"
+
 	"gemma.intevation.de/gemma/pkg/common"
 	"gemma.intevation.de/gemma/pkg/models"
 	"gemma.intevation.de/gemma/pkg/soap/ifaf"
-	"github.com/jackc/pgx/pgtype"
 )
 
 type FairwayAvailability struct {
@@ -34,11 +35,11 @@
 const (
 	listBottlenecksSQL = `
 SELECT
-	bottleneck_id,
-	responsible_country
+  bottleneck_id,
+  responsible_country
 FROM waterway.bottlenecks
 WHERE responsible_country = users.current_user_country()
-	AND staging_done = true
+  AND staging_done = true
 `
 	insertFASQL = `
 INSERT INTO waterway.fairway_availability (
@@ -60,63 +61,63 @@
 
 	insertBnPdfsSQL = `
 INSERT INTO waterway.bottleneck_pdfs (
-	fairway_availability_id,
-	profile_pdf_filename,
-	profile_pdf_url,
-	pdf_generation_date,
-	source_organization
+  fairway_availability_id,
+  profile_pdf_filename,
+  profile_pdf_url,
+  pdf_generation_date,
+  source_organization
 ) VALUES (
-	$1,
-	$2,
-	$3,
-	$4,
-	$5
+  $1,
+  $2,
+  $3,
+  $4,
+  $5
 )`
 	insertEFASQL = `
 INSERT INTO waterway.effective_fairway_availability (
-	fairway_availability_id,
-	measure_date,
-	level_of_service,
-	available_depth_value,
-	available_width_value,
-	water_level_value,
-	measure_type,
-	source_organization,
-	forecast_generation_time,
-	value_lifetime
+  fairway_availability_id,
+  measure_date,
+  level_of_service,
+  available_depth_value,
+  available_width_value,
+  water_level_value,
+  measure_type,
+  source_organization,
+  forecast_generation_time,
+  value_lifetime
 ) VALUES (
-	$1,
-	$2,
-	(SELECT
-		level_of_service
-	FROM levels_of_service
-	WHERE name = $3),
-	$4,
-	$5,
-	$6,
-	$7,
-	$8,
-	$9,
-	$10
+  $1,
+  $2,
+  (SELECT
+    level_of_service
+  FROM levels_of_service
+  WHERE name = $3),
+  $4,
+  $5,
+  $6,
+  $7,
+  $8,
+  $9,
+  $10
 )`
 	insertFAVSQL = `
 INSERT INTO waterway.fa_reference_values (
-	fairway_availability_id,
-	level_of_service,
-	fairway_depth,
-	fairway_width,
-	fairway_radius,
-	shallowest_spot
+  fairway_availability_id,
+  level_of_service,
+  fairway_depth,
+  fairway_width,
+  fairway_radius,
+  shallowest_spot
 ) VALUES (
-	$1,
-	(SELECT
-		level_of_service
-	FROM levels_of_service
-	WHERE name = $2),
-	$3,
-	$4,
-	$5,
-	ST_MakePoint($6, $7)::geography
+  $1,
+  (SELECT
+    level_of_service
+  FROM levels_of_service
+  WHERE name = $2),
+  $3,
+  $4,
+  $5,
+  ST_MakePoint($6, $7)::geography
 )`
 )