From 1daa72c23026adf3e057c7b6c47d5d35837258b5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Thu, 24 Jun 2010 10:39:19 +0200 Subject: [PATCH] Properly imports jobid in addresses. 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 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/upgrade/newdirectory-0.0.1/15_addresses.sql b/upgrade/newdirectory-0.0.1/15_addresses.sql index 84101de..824e69a 100644 --- a/upgrade/newdirectory-0.0.1/15_addresses.sql +++ b/upgrade/newdirectory-0.0.1/15_addresses.sql @@ -46,9 +46,10 @@ INSERT INTO profile_addresses (pid, id, postalCode, updateTime, pub, comment, l INSERT INTO profile_addresses (pid, jobid, id, postalCode, pub, comment, latitude, longitude, countryId, type) - SELECT uid, entrid, 0, postcode, adr_pub, NULL, glat, glng, - IF(country = '' OR country = '00', NULL, country), 'job' - FROM #x4dat#.entreprises; + SELECT e.uid, j.id, e.entrid, e.postcode, e.adr_pub, NULL, e.glat, e.glng, + IF(e.country = '' OR e.country = '00', NULL, e.country), 'job' + FROM #x4dat#.entreprises AS e + INNER JOIN profile_job_enum AS j ON (e.entreprise = j.name); DROP TABLE IF EXISTS geoloc_countries; CREATE TABLE geoloc_countries ( -- 2.1.4