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
@@ -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;
}