X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Ffusionax%2FFormations.sql;h=c1c22226a64e020928c5d84b15a63a5730537a3e;hb=db8f6227d53e3be99f01671a9d5536a20ebbab2f;hp=f583716154eb24a7820792ddc4b39f655f997a68;hpb=e48763dcb0ddaa3189273aaec566463945720b8a;p=platal.git diff --git a/modules/fusionax/Formations.sql b/modules/fusionax/Formations.sql index f583716..c1c2222 100644 --- a/modules/fusionax/Formations.sql +++ b/modules/fusionax/Formations.sql @@ -5,11 +5,27 @@ DROP TABLE IF EXISTS `fusionax_formations`; CREATE TABLE IF NOT EXISTS `fusionax_formations` ( FO CHAR(2) NOT NULL COMMENT 'Vaut toujours FO pour cette table', ax_id VARCHAR(8) NOT NULL COMMENT 'Id unique de l''ancien', - Intitule_diplome VARCHAR(60) NOT NULL COMMENT 'Intitulé du diplôme', - Intitule_formation VARCHAR(60) NOT NULL COMMENT 'Intitulé de la formation', - Descr_formation VARCHAR(60) NOT NULL COMMENT 'Description de la formation', - PRIMARY KEY (ax_id, Intitule_diplome, Intitule_formation) + Intitule_diplome VARCHAR(255) NOT NULL DEFAULT 0 COMMENT 'Intitulé du diplôme', + Intitule_formation VARCHAR(255) NOT NULL DEFAULT 0 COMMENT 'Intitulé de la formation', + Descr_formation VARCHAR(255) NOT NULL COMMENT 'Description de la formation', + pid INT(11) UNSIGNED DEFAULT NULL, + eduid INT(4) DEFAULT NULL, + degreeid INT(4) DEFAULT NULL, + fieldid INT(2) DEFAULT NULL, + PRIMARY KEY (ax_id, Intitule_diplome, Intitule_formation, Descr_formation), + INDEX (Intitule_diplome(60)), + INDEX (Intitule_formation(60)), + INDEX (Descr_formation(60)), + INDEX (pid), + INDEX (eduid), + INDEX (degreeid), + INDEX (fieldid) ) ENGINE=InnoDB, CHARSET=utf8; -LOAD DATA LOCAL INFILE '{?}Formations.txt' INTO TABLE fusionax_formations FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n' +LOAD DATA LOCAL INFILE '{?}Formations.txt' INTO TABLE fusionax_formations CHARACTER SET utf8 FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n' (FO, ax_id, Intitule_diplome, Intitule_formation, Descr_formation); + + UPDATE fusionax_formations AS f +INNER JOIN profile_education_enum AS e ON (f.Intitule_diplome = e.abbreviation) + SET f.Intitule_diplome = e.name + WHERE f.Intitule_diplome != '';