From d5df1c8ae399e31ca7b0619a25302a4c7b80afaa Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Fri, 5 Jan 2018 22:41:05 +0100 Subject: [PATCH] fix setup when no us_postcode is available --- utils/setup.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/utils/setup.php b/utils/setup.php index c6cc7773..8988fc51 100755 --- a/utils/setup.php +++ b/utils/setup.php @@ -540,10 +540,8 @@ if ($aCMDResult['calculate-postcodes'] || $aCMDResult['all']) { $sSQL .= ' FROM us_postcode WHERE postcode NOT IN'; $sSQL .= ' (SELECT postcode FROM location_postcode'; $sSQL .= " WHERE country_code = 'us')"; - } else { - $sSQL .= 'TRUNCATE TABLE us_postcode'; + if (!pg_query($oDB->connection, $sSQL)) fail(pg_last_error($oDB->connection)); } - if (!pg_query($oDB->connection, $sSQL)) fail(pg_last_error($oDB->connection)); // add missing postcodes for GB (if available) $sSQL = 'INSERT INTO location_postcode'; -- 2.39.5