]> git.mjollnir.org Git - moodle.git/commitdiff
[multienrol]DB upgrade script to clean up enrol field for user_students and user_teachers
authormartinlanghoff <martinlanghoff>
Thu, 9 Mar 2006 03:20:30 +0000 (03:20 +0000)
committermartinlanghoff <martinlanghoff>
Thu, 9 Mar 2006 03:20:30 +0000 (03:20 +0000)
lib/db/mysql.php
lib/db/postgres7.php

index 5663015eefd0480f59bf8f4e7aa6e461e9c6bac6..8fcbbda755cc6b12bcaba4efe8d468b1cb83a0b0 100644 (file)
@@ -1668,6 +1668,11 @@ function main_upgrade($oldversion=0) {
         }
     }
 
+    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;
 }
 
index 6d4ceacc1646465daf2b0606a215daa484d9d441..d123db91f84ae837fee47e96d5035df9c346b7d9 100644 (file)
@@ -1411,6 +1411,11 @@ function main_upgrade($oldversion=0) {
         }
     }
     
+    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;
 }