Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
DB upgrade script to clean up enrol field for user_students and user_…
…teachers (Merged from MOODLE_15_STABLE)
  • Loading branch information
patrickslee committed Oct 30, 2005
1 parent 78c7303 commit 739f3e5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/db/mysql.php
Expand Up @@ -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;
}

Expand Down
5 changes: 5 additions & 0 deletions lib/db/postgres7.php
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion version.php
Expand Up @@ -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
Expand Down

0 comments on commit 739f3e5

Please sign in to comment.