comparison pkg/imports/agm.go @ 4054:033a8e3fec8e historization_ng

Adapted agm-import to new historization model.
author Sascha Wilde <wilde@intevation.de>
date Wed, 24 Jul 2019 17:40:17 +0200
parents 4a7c2140e44b
children 4332b9e26e2f
comparison
equal deleted inserted replaced
4053:d7e85b85918f 4054:033a8e3fec8e
166 ` 166 `
167 167
168 agmInsertSQL = ` 168 agmInsertSQL = `
169 INSERT INTO waterway.gauge_measurements ( 169 INSERT INTO waterway.gauge_measurements (
170 location, 170 location,
171 validity,
172 measure_date, 171 measure_date,
173 country_code, 172 country_code,
174 sender, 173 sender,
175 language_code, 174 language_code,
176 date_issue, 175 date_issue,
179 date_info, 178 date_info,
180 source_organization, 179 source_organization,
181 staging_done 180 staging_done
182 ) VALUES ( 181 ) VALUES (
183 ($1::char(2), $2::char(3), $3::char(5), $4::char(5), $5::int), 182 ($1::char(2), $2::char(3), $3::char(5), $4::char(5), $5::int),
184 COALESCE(
185 (SELECT validity FROM waterway.gauges
186 WHERE location
187 = ($1::char(2), $2::char(3), $3::char(5), $4::char(5), $5::int)
188 AND validity @> CAST($6 AS timestamp with time zone)),
189 tstzrange(NULL, NULL)),
190 $6, 183 $6,
191 $7, 184 $7,
192 $8, 185 $8,
193 $9, 186 $9,
194 $10, 187 $10,