Permalink
Browse files

Upgrade all the defective module version numbers in the database

  • Loading branch information...
1 parent 18d30cd commit 93f14c02acd0584923701133e3ee869b6b8c1a76 moodler committed Nov 18, 2004
Showing with 57 additions and 2 deletions.
  1. +28 −0 lib/db/mysql.php
  2. +28 −1 lib/db/postgres7.php
  3. +1 −1 version.php
View
@@ -900,6 +900,34 @@ function main_upgrade($oldversion=0) {
if ($oldversion < 2004083128) { // one more index for email (for sorting)
modify_database('','ALTER TABLE `prefix_user` ADD INDEX prefix_user_email_idx (email);');
}
+
+ if ($oldversion < 2004083129) { // Undoing some module version mess from recent upgrade
+ if (get_field('modules', 'version', 'name', 'assignment') == '2004111200') {
+ set_field('modules', 'version', 2004060401, 'name', 'assignment');
+ }
+ if (get_field('modules', 'version', 'name', 'attendance') == '2004111200') {
+ set_field('modules', 'version', 2004060401, 'name', 'attendance');
+ }
+ if (get_field('modules', 'version', 'name', 'chat') == '2004121100') {
+ set_field('modules', 'version', 2004060401, 'name', 'chat');
+ }
+ if (get_field('modules', 'version', 'name', 'choice') == '2004111200') {
+ set_field('modules', 'version', 2004070103, 'name', 'choice');
+ }
+ if (get_field('modules', 'version', 'name', 'dialogue') == '2004111000') {
+ set_field('modules', 'version', 2004060401, 'name', 'dialogue');
+ }
+ if (get_field('modules', 'version', 'name', 'exercise') == '2004111200') {
+ set_field('modules', 'version', 2004062301, 'name', 'exercise');
+ }
+ if (get_field('modules', 'version', 'name', 'forum') == '2004111200') {
+ set_field('modules', 'version', 2004081801, 'name', 'forum');
+ }
+ if (get_field('modules', 'version', 'name', 'glossary') == '2004111200') {
+ set_field('modules', 'version', 2004080932, 'name', 'glossary');
+ }
+ }
+
return $result;
View
@@ -634,7 +634,34 @@ function main_upgrade($oldversion=0) {
if ($oldversion < 2004083128) { // one more index for email (for sorting)
modify_database('','CREATE INDEX prefix_user_email_idx ON prefix_user (email);');
- }
+ }
+
+ if ($oldversion < 2004083129) { // Undoing some module version mess from recent upgrade
+ if (get_field('modules', 'version', 'name', 'assignment') == '2004111200') {
+ set_field('modules', 'version', 2004060401, 'name', 'assignment');
+ }
+ if (get_field('modules', 'version', 'name', 'attendance') == '2004111200') {
+ set_field('modules', 'version', 2004060401, 'name', 'attendance');
+ }
+ if (get_field('modules', 'version', 'name', 'chat') == '2004121100') {
+ set_field('modules', 'version', 2004060401, 'name', 'chat');
+ }
+ if (get_field('modules', 'version', 'name', 'choice') == '2004111200') {
+ set_field('modules', 'version', 2004070103, 'name', 'choice');
+ }
+ if (get_field('modules', 'version', 'name', 'dialogue') == '2004111000') {
+ set_field('modules', 'version', 2004060401, 'name', 'dialogue');
+ }
+ if (get_field('modules', 'version', 'name', 'exercise') == '2004111200') {
+ set_field('modules', 'version', 2004062301, 'name', 'exercise');
+ }
+ if (get_field('modules', 'version', 'name', 'forum') == '2004111200') {
+ set_field('modules', 'version', 2004081801, 'name', 'forum');
+ }
+ if (get_field('modules', 'version', 'name', 'glossary') == '2004111200') {
+ set_field('modules', 'version', 2004080932, 'name', 'glossary');
+ }
+ }
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 = 2004083128; // YYYYMMDD = date of first major branch release 1.4
+ $version = 2004083129; // YYYYMMDD = date of first major branch release 1.4
// X = point release version 1,2,3 etc
// Y = increments between point releases

0 comments on commit 93f14c0

Please sign in to comment.