Permalink
Browse files

DB upgrade script to clean up enrol field for user_students and user_…

…teachers (Merged from MOODLE_15_STABLE)
  • Loading branch information...
patrickslee
patrickslee committed Oct 30, 2005
1 parent 78c7303 commit 739f3e50676dc4990b90ac043c40ec7433b7dff0
Showing with 11 additions and 1 deletion.
  1. +5 −0 lib/db/mysql.php
  2. +5 −0 lib/db/postgres7.php
  3. +1 −1 version.php
View
@@ -1653,6 +1653,11 @@ function main_upgrade($oldversion=0) {
table_column('course_request','','password','varchar',50);
}
+ 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;
}
View
@@ -1395,6 +1395,11 @@ function main_upgrade($oldversion=0) {
table_column('course_request','','password','text');
}
+ 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;
}
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 = 2005101200; // YYYYMMDD = date
+ $version = 2005103100; // YYYYMMDD = date
// XY = increments within a single day
$release = '1.6 development'; // Human-friendly version name

0 comments on commit 739f3e5

Please sign in to comment.