From: Stéphane Jacob Date: Sat, 10 Jan 2009 00:12:07 +0000 (+0100) Subject: Fixes profile_display creation errors. X-Git-Tag: xorg/1.0.0~332^2~344^2~40 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=75036b0fbfddcb221463a39330c0592dfd776209;p=platal.git Fixes profile_display creation errors. --- diff --git a/upgrade/newdirectory-0.0.1/00_names.sql b/upgrade/newdirectory-0.0.1/00_names.sql index fdbea10..c4a0ce4 100644 --- a/upgrade/newdirectory-0.0.1/00_names.sql +++ b/upgrade/newdirectory-0.0.1/00_names.sql @@ -1,3 +1,5 @@ +DROP TABLE IF EXISTS profile_display; + CREATE TABLE profile_display ( pid INT(11) NOT NULL DEFAULT 0, yourself VARCHAR(255) NOT NULL, @@ -7,7 +9,7 @@ CREATE TABLE profile_display ( short_name VARCHAR(255) NOT NULL, sort_name VARCHAR(255) NOT NULL, promo VARCHAR(255) DEFAULT '' NOT NULL, - PRIMARY KEY(uid) + PRIMARY KEY(pid) ) CHARSET=utf8; INSERT INTO profile_display (pid, yourself, public_name, private_name, directory_name, short_name, sort_name) @@ -15,7 +17,7 @@ INSERT INTO profile_display (pid, yourself, public_name, private_name, director CONCAT(u.prenom, ' ', IF(u.nom_usage != '', CONCAT(u.nom_usage, ' (', u.nom, ')') , u.nom)), CONCAT(u.prenom, ' ', IF(u.nom_usage != '', CONCAT(u.nom_usage, ' (', u.nom, ')') , u.nom), IF(q.profile_nick != '', CONCAT(' (alias ', q.profile_nick, ')'), '')), - CONCAT(IF(u.nom_usage != '', CONCAT(u.nom_usage, ' (', u.nom, ')') , u.nom), ', ', u.prenom), + CONCAT(IF(u.nom_usage != '', CONCAT(u.nom_usage, ' (', u.nom, ')') , u.nom), ' ', u.prenom), CONCAT(u.prenom, ' ', IF(u.nom_usage != '', u.nom_usage, u.nom)), CONCAT(IF(u.nom_usage != '', u.nom_usage, u.nom), ' ', u.prenom) FROM auth_user_md5 AS u diff --git a/upgrade/newdirectory-0.0.1/10_promotion.sql b/upgrade/newdirectory-0.0.1/10_promotion.sql index 785ce31..de629b4 100644 --- a/upgrade/newdirectory-0.0.1/10_promotion.sql +++ b/upgrade/newdirectory-0.0.1/10_promotion.sql @@ -4,9 +4,9 @@ INSERT INTO profile_education (id, uid, grad_year, entry_year, eduid, degreeid, LEFT JOIN profile_education_enum AS e ON (e.abbreviation = "X") LEFT JOIN profile_education_degree_enum AS d ON (d.degree = "Ingénieur"); -REPLACE IGNORE INTO profile_display (pid, promo) - SELECT uid, CONCAT("X", entry_year) - FROM profile_education - WHERE FIND_IN_SET('primary', flags); + UPDATE profile_display AS d +INNER JOIN profile_education AS e ON (d.pid = e.uid) + SET d.promo = CONCAT("X", entry_year) + WHERE FIND_IN_SET('primary', e.flags); -- vim:set syntax=mysql: