]> git.mjollnir.org Git - moodle.git/commitdiff
upgrading database with new values for the new fields
authormoodler <moodler>
Thu, 1 Jul 2004 09:17:37 +0000 (09:17 +0000)
committermoodler <moodler>
Thu, 1 Jul 2004 09:17:37 +0000 (09:17 +0000)
mod/choice/db/mysql.php
mod/choice/db/postgres7.php
mod/choice/version.php

index 6dd3e21cf2e08b640aaa331bcbc8bc75ab982132..baa4aec1ee5a38a84675481f7b8f71ef3271d310 100644 (file)
@@ -37,6 +37,10 @@ function choice_upgrade($oldversion) {
         table_column("choice", "", "release", "integer", "2", "unsigned", "0", "", "publish");
         table_column("choice", "", "allowupdate", "integer", "2", "unsigned", "0", "", "release");
     }
+    if ($oldversion < 2004070102) {
+        modify_database("", "UPDATE prefix_choice SET release = '1' WHERE publish > 0;");
+        modify_database("", "UPDATE prefix_choice SET publish = publish - 1 WHERE publish > 0;");
+    }
 
 
     return true;
index d74a4a8c0608f518228824eeac46686312686226..96a54c03162cfa9db9c975b675ff26dbc852efa0 100644 (file)
@@ -23,6 +23,10 @@ function choice_upgrade($oldversion) {
         table_column("choice", "", "release", "integer", "2", "unsigned", "0", "", "publish");
         table_column("choice", "", "allowupdate", "integer", "2", "unsigned", "0", "", "release");
     }
+    if ($oldversion < 2004070102) {
+        modify_database("", "UPDATE prefix_choice SET release = '1' WHERE publish > 0;");
+        modify_database("", "UPDATE prefix_choice SET publish = publish - 1 WHERE publish > 0;");
+    }
 
     return true;
 }
index 473bb17e32ca5f38b6c0237efbf83a0490be3ae1..f80f7b30cf3ced2786807cf3eeac0c02a6a373c5 100644 (file)
@@ -5,7 +5,7 @@
 //  This fragment is called by /admin/index.php
 ////////////////////////////////////////////////////////////////////////////////
 
-$module->version  = 2004070101;
+$module->version  = 2004070102;
 $module->requires = 2004052501;  // Requires this Moodle version
 $module->cron     = 0;