From 75036b0fbfddcb221463a39330c0592dfd776209 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Sat, 10 Jan 2009 01:12:07 +0100 Subject: [PATCH] Fixes profile_display creation errors. --- upgrade/newdirectory-0.0.1/00_names.sql | 6 ++++-- upgrade/newdirectory-0.0.1/10_promotion.sql | 8 ++++---- 2 files changed, 8 insertions(+), 6 deletions(-) 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: -- 2.1.4