From: Stéphane Jacob Date: Thu, 24 Jun 2010 08:39:19 +0000 (+0200) Subject: Properly imports jobid in addresses. X-Git-Tag: xorg/1.0.0~57 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=1daa72c23026adf3e057c7b6c47d5d35837258b5;p=platal.git Properly imports jobid in addresses. 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 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 (