DB upgrade script to clean up enrol field for user_students and user_teachers

This commit is contained in:
patrickslee
2005-10-30 21:36:19 +00:00
parent f0a73113d5
commit 80fc4f88be
3 changed files with 11 additions and 1 deletions
+5
View File
@@ -1460,6 +1460,11 @@ function main_upgrade($oldversion=0) {
execute_sql("DROP TABLE {$CFG->prefix}currencies",false); // drop silently
}
if ($oldversion < 2005103100) { // Repair enrol field in user_students/user_teacher table
execute_sql("UPDATE {$CFG->prefix}user_students SET enrol='manual' WHERE enrol='' OR enrol='internal'");
execute_sql("UPDATE {$CFG->prefix}user_teachers SET enrol='manual' WHERE enrol=''");
}
return $result;
}
+5
View File
@@ -1203,6 +1203,11 @@ function main_upgrade($oldversion=0) {
modify_database('','ALTER TABLE prefix_user_teachers ALTER enrol SET NOT NULL');
}
if ($oldversion < 2005103100) { // Repair enrol field in user_students/user_teacher table
execute_sql("UPDATE {$CFG->prefix}user_students SET enrol='manual' WHERE enrol='' OR enrol='internal'");
execute_sql("UPDATE {$CFG->prefix}user_teachers SET enrol='manual' WHERE enrol=''");
}
return $result;
}
+1 -1
View File
@@ -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 = 2005060223; // YYYYMMDD = Moodle 1.5 Date
$version = 2005103100; // YYYYMMDD = Moodle 1.5 Date
// X = Moodle 1.5 Point release (0,1,2...)
// Y = Interim incrementer