Typos
[platal.git] / upgrade / newdirectory-0.0.1 / 15_addresses.sql
index 0d9ef47..8ce64b6 100644 (file)
@@ -38,12 +38,19 @@ INSERT INTO  profile_addresses (pid, id, postalCode, updateTime, pub, comment, l
                                 countryId, type, flags)
      SELECT  uid, adrid, postcode, datemaj, pub, NULL, glat, glng, IF(country = '' OR country = '00', NULL, country),
              IF(FIND_IN_SET('pro', 'statut'), 'job', 'home'),
-             CONCAT(IF(FIND_IN_SET('res-secondaire', 'statut'), 'secondary,', ''),
-                    IF(FIND_IN_SET('courrier', 'statut'), 'mail,', ''),
-                    IF(FIND_IN_SET('active', 'statut'), 'current,', ''),
-                    IF(FIND_IN_SET('temporaire', 'statut'), 'temporary', ''))
+             CONCAT(IF(FIND_IN_SET('res-secondaire', statut), 'secondary,', ''),
+                    IF(FIND_IN_SET('courrier', statut), 'mail,', ''),
+                    IF(FIND_IN_SET('active', statut), 'current,', ''),
+                    IF(FIND_IN_SET('temporaire', statut), 'temporary', ''))
        FROM  #x4dat#.adresses;
 
+INSERT INTO  profile_addresses (pid, jobid, id, postalCode, pub, comment,
+                                latitude, longitude, countryId, type)
+     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 (
   iso_3166_1_a2 CHAR(2) NOT NULL,