add script for updating postcodes

This commit is contained in:
Sarah Hoffmann
2017-10-03 12:07:26 +02:00
parent 8e2ef2842e
commit bafbf679b6
3 changed files with 64 additions and 3 deletions

View File

@@ -541,8 +541,10 @@ if ($aCMDResult['calculate-postcodes'] || $aCMDResult['all']) {
$sSQL .= " (SELECT postcode FROM location_postcode";
$sSQL .= " WHERE country_code = 'us')";
if (!pg_query($oDB->connection, $sSQL)) fail(pg_last_error($oDB->connection));
} else {
$sSQL .= "TRUNCATE TABLE us_postcode";
}
if (!pg_query($oDB->connection, $sSQL)) fail(pg_last_error($oDB->connection));
// add missing postcodes for GB (if available)
$sSQL = "INSERT INTO location_postcode";