From 44b757f4473d3c9d2025f104ae7a2959f535e529 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Sun, 14 Feb 2021 22:38:50 +0100 Subject: [PATCH] removed some useless fields --- config/postupgrade-db.py | 21 ------------------- .../Bulletins-Orleans/index.php | 3 +-- misc/createtables.sql | 12 +++++++++++ 3 files changed, 13 insertions(+), 23 deletions(-) diff --git a/config/postupgrade-db.py b/config/postupgrade-db.py index e423984c..1c69351d 100755 --- a/config/postupgrade-db.py +++ b/config/postupgrade-db.py @@ -583,27 +583,6 @@ for dept in get_depts(): ], ) - # add etape_apo2 - check_field( - cnx, - "notes_formsemestre", - "etape_apo2", - ["alter table notes_formsemestre add column etape_apo2 text"], - ) - # add etape_apo3 - check_field( - cnx, - "notes_formsemestre", - "etape_apo3", - ["alter table notes_formsemestre add column etape_apo3 text"], - ) - # add etape_apo4 - check_field( - cnx, - "notes_formsemestre", - "etape_apo4", - ["alter table notes_formsemestre add column etape_apo4 text"], - ) # add publish_incomplete check_field( cnx, diff --git a/misc/PublicationBulletins/Bulletins-Orleans/index.php b/misc/PublicationBulletins/Bulletins-Orleans/index.php index 5e3259b1..891f7744 100644 --- a/misc/PublicationBulletins/Bulletins-Orleans/index.php +++ b/misc/PublicationBulletins/Bulletins-Orleans/index.php @@ -99,8 +99,7 @@ function get_semestre_info($sem, $dept) { // Renvoi les informations détaillées d'un semestre // Ne nécessite pas d'authentification avec sco_user et sco_pw - Il est possible de choisir le format XML ou JSON. // formsemestre_list -// Paramètres (tous optionnels): formsesmestre_id, formation_id, etape_apo, etape_apo2 -// Coquille dans la doc : formsesmestre_id +// Paramètres (tous optionnels): formsemestre_id, formation_id, etape_apo // Résultat: liste des semestres correspondant. // Exemple: formsemestre_list?format=xml&etape_apo=V1RT global $sco_pw; diff --git a/misc/createtables.sql b/misc/createtables.sql index bc937d0d..c42e50fd 100644 --- a/misc/createtables.sql +++ b/misc/createtables.sql @@ -35,6 +35,18 @@ CREATE FUNCTION notes_newid_etud( text ) returns text as ' as result; ' language SQL; +-- Fonction pour anonymisation: +-- inspirée par https://www.simononsoftware.com/random-string-in-postgresql/ +CREATE FUNCTION random_text_md5( integer ) returns text + LANGUAGE SQL + AS $$ + select upper( substring( (SELECT string_agg(md5(random()::TEXT), '') + FROM generate_series( + 1, + CEIL($1 / 32.)::integer) + ), 1, $1) ); + $$; + -- Preferences CREATE TABLE sco_prefs ( pref_id text DEFAULT notes_newid('PREF'::text) UNIQUE NOT NULL,