From: Stéphane Jacob Date: Tue, 1 Jun 2010 14:35:51 +0000 (+0200) Subject: Prevents import of non-exiting country ids. X-Git-Tag: xorg/1.0.0~203 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=30c41429d61899a75ab5c490e8cc2798a1bbbf21;p=platal.git Prevents import of non-exiting country ids. Signed-off-by: Stéphane Jacob --- 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,', ''),