From 30c41429d61899a75ab5c490e8cc2798a1bbbf21 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Tue, 1 Jun 2010 16:35:51 +0200 Subject: [PATCH] Prevents import of non-exiting country ids. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- upgrade/newdirectory-0.0.1/15_addresses.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/upgrade/newdirectory-0.0.1/15_addresses.sql b/upgrade/newdirectory-0.0.1/15_addresses.sql index 0294ea4..a9c9486 100644 --- a/upgrade/newdirectory-0.0.1/15_addresses.sql +++ b/upgrade/newdirectory-0.0.1/15_addresses.sql @@ -34,8 +34,8 @@ CREATE TABLE profile_addresses ( INDEX countryId (countryId) ) ENGINE=InnoDB, CHARSET=utf8; -INSERT INTO profile_addresses (pid, id, postalCode, updateTime, pub, comment, latitude, longitude, countryId, - type, flags) +INSERT INTO profile_addresses (pid, id, postalCode, updateTime, pub, comment, latitude, longitude, + IF(countryId = '' OR countryId = '00', NULL, countryId), type, flags) SELECT uid, adrid, postcode, datemaj, pub, NULL, glat, glng, country, IF(FIND_IN_SET('pro', 'statut'), 'job', 'home'), CONCAT(IF(FIND_IN_SET('res-secondaire', 'statut'), 'secondary,', ''), -- 2.1.4