Some entries of geoloc_pays MUST NOT be used as a nationality.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 31 Aug 2008 11:50:54 +0000 (13:50 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 31 Aug 2008 11:50:54 +0000 (13:50 +0200)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
plugins/function.select_nat.php
upgrade/0.9.18/01_nat.sql [new file with mode: 0644]

index bc0401c..e17b738 100644 (file)
@@ -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 (file)
index 0000000..7bed2d9
--- /dev/null
@@ -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: