From cc343083eb37b50dde28bc3ae6ab9cb5bcf97455 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Sun, 31 Aug 2008 13:50:54 +0200 Subject: [PATCH] Some entries of geoloc_pays MUST NOT be used as a nationality. Signed-off-by: Florent Bruneau --- plugins/function.select_nat.php | 2 +- upgrade/0.9.18/01_nat.sql | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 upgrade/0.9.18/01_nat.sql diff --git a/plugins/function.select_nat.php b/plugins/function.select_nat.php index bc0401c..e17b738 100644 --- a/plugins/function.select_nat.php +++ b/plugins/function.select_nat.php @@ -21,7 +21,7 @@ function select_nat($valeur,$pad=false) { - $sql = "SELECT a2 AS id,IF(nat='',pays,nat) AS text FROM geoloc_pays ORDER BY text"; + $sql = "SELECT a2 AS id,IF(nat='',pays,nat) AS text FROM geoloc_pays WHERE nat IS NOT NULL ORDER BY text"; $res = XDB::iterRow($sql); $sel = ' selected="selected"'; diff --git a/upgrade/0.9.18/01_nat.sql b/upgrade/0.9.18/01_nat.sql new file mode 100644 index 0000000..7bed2d9 --- /dev/null +++ b/upgrade/0.9.18/01_nat.sql @@ -0,0 +1,8 @@ +alter table geoloc_pays change column nat nat varchar(100); +update geoloc_pays + set nat = NULL + where a2 = 'MQ' or a2 = 'RE' or a2 = 'GP' or a2 = 'YT' or a2 = 'TF' or a2 = 'PF' or a2 = 'NC' or a2 = 'GF' + or a2 = 'UM'; +update auth_user_md5 set nationalite = 'FR' where nationalite = 'MQ' or nationalite = 'RE' or nationalite = 'GP' or nationalite = 'YT' or nationalite = 'TF' or nationalite = 'PF' or nationalite = 'NC' or nationalite = 'GF'; + +# vim:set syntax=mysql: -- 2.1.4