A few fixes in DB upgrade scripts.
authorStéphane Jacob <sj@m4x.org>
Tue, 22 Jun 2010 10:42:26 +0000 (12:42 +0200)
committerStéphane Jacob <sj@m4x.org>
Tue, 22 Jun 2010 10:42:26 +0000 (12:42 +0200)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
upgrade/account/20_naming_convention.sql
upgrade/account/30_insertion.sql [moved from upgrade/account/99_insertion.sql with 100% similarity]
upgrade/account/40_xnet_groups.sql [moved from upgrade/account/30_xnet_groups.sql with 100% similarity]
upgrade/newdirectory-0.0.1/09_education.sql
upgrade/newdirectory-0.0.1/15_addresses.sql

index c5cf76c..35a98dc 100644 (file)
@@ -73,7 +73,7 @@ CHANGE COLUMN  uid pid INT(11) NOT NULL;
 
 # group
   ALTER TABLE  group_announces
-CHANGE COLUMN  user_id uid INT(11) NOT NULL;
+CHANGE COLUMN  user_id uid INT(11) NOT NULL,
 CHANGE COLUMN  peremption expiration DATE NOT NULL;
   ALTER TABLE  group_announces_read
 CHANGE COLUMN  user_id uid INT(11) NOT NULL;
index c0bfd58..058ad93 100644 (file)
@@ -153,7 +153,7 @@ SET abbreviation = 'Sciences Po', name = 'Institut d\'Études Politiques de Pari
 WHERE name = 'IEP Paris';
 UPDATE profile_education_enum
 SET abbreviation = 'Sciences Po Aix', name = 'Institut d\'Études Politiques d\'Aix-en-Provence'
-WHERE name = 'IEP Aix'
+WHERE name = 'IEP Aix';
 UPDATE profile_education_enum
 SET abbreviation = 'EHESS', name = 'École des Hautes Études en Sciences Sociales'
 WHERE name = 'EHESS';
index a9c9486..0d9ef47 100644 (file)
@@ -35,8 +35,8 @@ CREATE TABLE profile_addresses (
 ) ENGINE=InnoDB, CHARSET=utf8;
 
 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,
+                                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,', ''),
@@ -287,7 +287,7 @@ INSERT INTO  geoloc_countries (iso_3166_1_a2, iso_3166_1_a3, iso_3166_1_num, wor
                      WHEN "ER" THEN 232
                      ELSE n3 END,
              worldrgn, pays, country, capital, nat,
-             phoneprf, phoneformat, t.code
+             phoneprf, '', t.code
        FROM  #x4dat#.geoloc_pays AS g
  INNER JOIN  tmp_update_geoloc_pays AS t ON (t.a2 = g.a2);