DB upgrade script to clean up enrol field for user_students and user_teachers
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user