]> git.mjollnir.org Git - moodle.git/commitdiff
First model of new upgrade.php scripts and comments in old ones.
authorstronk7 <stronk7>
Wed, 25 Oct 2006 23:29:44 +0000 (23:29 +0000)
committerstronk7 <stronk7>
Wed, 25 Oct 2006 23:29:44 +0000 (23:29 +0000)
Need validation before extending them everywhere across core. MDL-7214

Merged from MOODLE_17_STABLE

mod/glossary/db/mysql.php
mod/glossary/db/postgres7.php
mod/glossary/db/upgrade.php [new file with mode: 0644]

index 11406096f5e130a20967387ca15f4c09d8f51cb1..a7392c26413bd5688677a349c93d3bbc9a00ec54 100644 (file)
@@ -1,6 +1,9 @@
 <?php   // $Id$
 
-
+// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
+//
+// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL 
+// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
 
 function glossary_upgrade($oldversion) {
 /// This function does anything necessary to upgrade
@@ -440,6 +443,8 @@ function glossary_upgrade($oldversion) {
          table_column('glossary_comments', 'comment', 'entrycomment', 'text', '', '', '');
     }
 
+    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
+
     return true;
 }
 
index 0e5296b1e3092c6cff7945fd863299b1d09846c3..f56614af1a4be059f6ae29ea3dbe2e68139c3635 100644 (file)
@@ -1,5 +1,10 @@
 <?php  // $Id$
 
+// THIS FILE IS DEPRECATED!  PLEASE DO NOT MAKE CHANGES TO IT!
+//
+// IT IS USED ONLY FOR UPGRADES FROM BEFORE MOODLE 1.7, ALL 
+// LATER CHANGES SHOULD USE upgrade.php IN THIS DIRECTORY.
+
 function glossary_upgrade($oldversion) {
 /// This function does anything necessary to upgrade 
 /// older versions to match current functionality 
@@ -204,6 +209,8 @@ function glossary_upgrade($oldversion) {
         table_column('glossary_comments', 'comment', 'entrycomment', 'text', '', '', '');
     }
 
+    //////  DO NOT ADD NEW THINGS HERE!!  USE upgrade.php and the lib/ddllib.php functions.
+
     return true;
 }
 
diff --git a/mod/glossary/db/upgrade.php b/mod/glossary/db/upgrade.php
new file mode 100644 (file)
index 0000000..5acf854
--- /dev/null
@@ -0,0 +1,36 @@
+<?PHP  //$Id$
+
+// This file keeps track of upgrades to 
+// the glossary module
+//
+// Sometimes, changes between versions involve
+// alterations to database structures and other
+// major things that may break installations.
+//
+// The upgrade function in this file will attempt
+// to perform all the necessary actions to upgrade
+// your older installtion to the current version.
+//
+// If there's something it cannot do itself, it
+// will tell you what you need to do.
+//
+// The commands in here will all be database-neutral,
+// using the functions defined in lib/ddllib.php
+
+function xmldb_glossary_upgrade($oldversion=0) {
+
+    global $CFG, $THEME, $db;
+
+    $result = true;
+
+/// And upgrade begins here. For each one, you'll need on block of code similar to the
+/// next one. Please, delete this comment lines once this file start handling proper
+/// upgrade code.
+///    if ($oldversion < YYYYMMDDII) { // Version we are upgrading to (match version.php)
+///    
+///    }
+
+    return $result;
+}
+
+?>