Permalink
Browse files

Upgrade path for MDL-13060.

  • Loading branch information...
1 parent 5a66d54 commit e7246110425e640ef2d71380feef6e2f572b9deb scyrma committed Jan 29, 2008
Showing with 29 additions and 2 deletions.
  1. +14 −1 lib/db/mysql.php
  2. +14 −0 lib/db/postgres7.php
  3. +1 −1 version.php
View
@@ -1989,7 +1989,20 @@ function main_upgrade($oldversion=0) {
set_field('modules', 'version', 2005031422, 'name', 'hotpot');
}
}
-
+
+ if ($result && $oldversion < 2006050561) {
+ $db->debug = false;
+ notify('Updating country list according to recent official ISO listing...', 'notifysuccess');
+ // re-assign users to valid countries
+ set_field('user', 'country', 'CD', 'country', 'ZR'); // Zaire is now Congo Democratique
+ set_field('user', 'country', 'TL', 'country', 'TP'); // Timor has changed
+ set_field('user', 'country', 'FR', 'country', 'FX'); // France metropolitaine doesn't exist
+ set_field('user', 'country', 'RS', 'country', 'KO'); // Kosovo is part of Serbia, "under the auspices of the United Nations, pursuant to UN Security Council Resolution 1244 of 10 June 1999."
+ set_field('user', 'country', 'GB', 'country', 'WA'); // Wales is part of UK (ie Great Britain)
+ set_field('user', 'country', 'RS', 'country', 'CS'); // Re-assign Serbia-Montenegro to Serbia. This is arbitrary, but there is no way to make an automatic decision on this.
+ notify('...update complete. Remember to update your language packs to get the most recent country names definitions and codes. This is especially important for sites with users from Congo (now CD), Timor (now TL), Kosovo (now RS), Wales (now GB), Serbia (RS) and Montenegro (ME). Users based in Montenegro (ME) will need to manually update their profile.', 'notifysuccess');
+ $db->debug = true;
+ }
return $result;
}
View
@@ -1608,6 +1608,20 @@ function main_upgrade($oldversion=0) {
}
}
+ if ($result && $oldversion < 2006050561) {
+ $db->debug = false;
+ notify('Updating country list according to recent official ISO listing...', 'notifysuccess');
+ // re-assign users to valid countries
+ set_field('user', 'country', 'CD', 'country', 'ZR'); // Zaire is now Congo Democratique
+ set_field('user', 'country', 'TL', 'country', 'TP'); // Timor has changed
+ set_field('user', 'country', 'FR', 'country', 'FX'); // France metropolitaine doesn't exist
+ set_field('user', 'country', 'RS', 'country', 'KO'); // Kosovo is part of Serbia, "under the auspices of the United Nations, pursuant to UN Security Council Resolution 1244 of 10 June 1999."
+ set_field('user', 'country', 'GB', 'country', 'WA'); // Wales is part of UK (ie Great Britain)
+ set_field('user', 'country', 'RS', 'country', 'CS'); // Re-assign Serbia-Montenegro to Serbia. This is arbitrary, but there is no way to make an automatic decision on this.
+ notify('...update complete. Remember to update your language packs to get the most recent country names definitions and codes. This is especially important for sites with users from Congo (now CD), Timor (now TL), Kosovo (now RS), Wales (now GB), Serbia (RS) and Montenegro (ME). Users based in Montenegro (ME) will need to manually update their profile.', 'notifysuccess');
+ $db->debug = true;
+ }
+
return $result;
}
View
@@ -6,7 +6,7 @@
// This is compared against the values stored in the database to determine
// whether upgrades should be performed (see lib/db/*.php)
- $version = 2006050560; // YYYYMMDD = date of the 1.6 branch (don't change)
+ $version = 2006050561; // YYYYMMDD = date of the 1.6 branch (don't change)
// X = release number 1.6.[0,1,2,3...]
// Y = micro-increments between releases

0 comments on commit e724611

Please sign in to comment.