From 3a703848c737e680fb2e301914095c06b80ef889 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Tue, 26 Aug 2008 16:55:44 +0200 Subject: [PATCH] Adapts watch_profile table for nationalities and education notification. --- upgrade/fusionax-0.0.1/05_nationalities.sql | 4 ++++ upgrade/fusionax-0.0.1/06_education.sql | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/upgrade/fusionax-0.0.1/05_nationalities.sql b/upgrade/fusionax-0.0.1/05_nationalities.sql index 48fe5fd..a7a585e 100644 --- a/upgrade/fusionax-0.0.1/05_nationalities.sql +++ b/upgrade/fusionax-0.0.1/05_nationalities.sql @@ -8,4 +8,8 @@ UPDATE auth_user_md5 SET nationalite=NULL WHERE nationalite="00" OR nationalite= DELETE FROM geoloc_pays WHERE a2="00"; +ALTER TABLE watch_profile MODIFY field enum('nom', 'freetext', 'mobile', 'nationalite', 'nationalite2', 'nationalite3', + 'nick', 'web', 'networking', 'appli1', 'appli2', 'addresses', + 'section', 'binets', 'medals', 'cv', 'jobs', 'photo'); + # vim:set syntax=mysql: diff --git a/upgrade/fusionax-0.0.1/06_education.sql b/upgrade/fusionax-0.0.1/06_education.sql index 35ca940..16982fa 100644 --- a/upgrade/fusionax-0.0.1/06_education.sql +++ b/upgrade/fusionax-0.0.1/06_education.sql @@ -64,6 +64,27 @@ INSERT INTO profile_education (id, uid, eduid, degreeid) FROM applis_ins AS a INNER JOIN profile_education_degree_enum AS d ON (a.type = d.degree); + UPDATE watch_profile AS w1 + INNER JOIN watch_profile AS w2 ON (w1.uid = w2.uid AND w1.field = 'appli1' AND w2.field = 'appli2') + SET w1.ts = IF(w1.ts > w2.ts, w1.ts, w2.ts), w2.ts = IF(w1.ts > w2.ts, w1.ts, w2.ts); + +INSERT IGNORE INTO watch_profile (uid, ts, field) + SELECT uid, ts, 'appli1' + FROM watch_profile + WHERE field = 'appli2'; + +ALTER TABLE watch_profile MODIFY field enum('nom', 'freetext', 'mobile', 'nationalite', 'nationalite2', + 'nationalite3', 'nick', 'web', 'networking', 'appli1', 'appli2', + 'edus', 'addresses', 'section', 'binets', 'medals', 'cv', 'jobs', + 'photo'); + +UPDATE watch_profile SET field = 'edus' WHERE field = 'appli1'; + +DELETE FROM watch_profile WHERE field = 'appli2'; + +ALTER TABLE watch_profile MODIFY field enum('nom', 'freetext', 'mobile', 'nationalite', 'nationalite2', + 'nationalite3', 'nick', 'web', 'networking', 'edus', 'addresses', + 'section', 'binets', 'medals', 'cv', 'jobs', 'photo'); # vim:set syntax=mysql: -- 2.1.4