From d187b7cc00180ff7919407ba158589397edb9665 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Tue, 26 Oct 2010 11:14:33 +0200 Subject: [PATCH] Fixes nationalities merge. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- upgrade/1.0.1/merge.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/upgrade/1.0.1/merge.php b/upgrade/1.0.1/merge.php index be5407e..e1e7ba5 100755 --- a/upgrade/1.0.1/merge.php +++ b/upgrade/1.0.1/merge.php @@ -124,17 +124,17 @@ XDB::rawExecute("INSERT IGNORE INTO profile_merge_issues (pid, issues, entry_ye XDB::rawExecute('ALTER TABLE geoloc_countries ADD INDEX (licensePlate)'); XDB::rawExecute('UPDATE profiles AS p INNER JOIN fusionax_anciens AS f ON (p.pid = f.pid) - INNER JOIN geoloc_countries AS g ON (g.licensePlate = f.Code_nationalite) + INNER JOIN geoloc_countries AS g ON (g.licensePlate = f.Code_nationalite AND g.nationalityFR IS NOT NULL) SET p.nationality1 = g.iso_3166_1_a2 WHERE p.nationality1 IS NULL'); XDB::rawExecute('UPDATE profiles AS p INNER JOIN fusionax_anciens AS f ON (p.pid = f.pid) - INNER JOIN geoloc_countries AS g ON (g.licensePlate = f.Code_nationalite) + INNER JOIN geoloc_countries AS g ON (g.licensePlate = f.Code_nationalite AND g.nationalityFR IS NOT NULL) SET p.nationality2 = g.iso_3166_1_a2 WHERE p.nationality1 != g.iso_3166_1_a2 AND p.nationality2 IS NULL'); XDB::rawExecute('UPDATE profiles AS p INNER JOIN fusionax_anciens AS f ON (p.pid = f.pid) - INNER JOIN geoloc_countries AS g ON (g.licensePlate = f.Code_nationalite) + INNER JOIN geoloc_countries AS g ON (g.licensePlate = f.Code_nationalite AND g.nationalityFR IS NOT NULL) SET p.nationality3 = g.iso_3166_1_a2 WHERE p.nationality1 != g.iso_3166_1_a2 AND p.nationality2 != g.iso_3166_1_a2 AND p.nationality3 IS NULL'); XDB::rawExecute('ALTER TABLE geoloc_countries DROP INDEX licensePlate'); -- 2.1.4