]> git.mjollnir.org Git - moodle.git/commitdiff
Now adds the config table automatically if there isn't one yet.
authormartin <martin>
Mon, 29 Jul 2002 15:09:16 +0000 (15:09 +0000)
committermartin <martin>
Mon, 29 Jul 2002 15:09:16 +0000 (15:09 +0000)
admin/index.php
version.php

index 0dd554ea0205547164f20ed03fe541bfbe58b77f..0309fc3dd73a811c144c5d0c56d34ac4f1286ddf 100644 (file)
             print_heading("<A HREF=\"index.php\">Continue</A>");
             die;
         } else {
-            error("A problem occurred inserting current version into databases");
+            if (upgrade_moodle(0)) {
+                print_heading("<A HREF=\"index.php\">Continue</A>");
+            } else {
+                error("A problem occurred inserting current version into databases");
+            }
         }
     }
 
index 7198bf0b440766d7792ce6b28b146cc2d7c51a3c..3d820f01adcf2acbbde0a4bb42b08126223630a9 100644 (file)
 // If there's something it cannot do itself, it 
 // will tell you what you need to do.
 
-$version = 2002072704;
+$version = 2002072801;
 
-function upgrade_moodle($oldversion) {
+function upgrade_moodle($oldversion=0) {
 
+    if ($oldversion == 0) {
+        execute_sql("
+          CREATE TABLE `config` (
+            `id` int(10) unsigned NOT NULL auto_increment,
+            `name` varchar(255) NOT NULL default '',
+            `value` varchar(255) NOT NULL default '',
+            PRIMARY KEY  (`id`),
+            UNIQUE KEY `name` (`name`)
+          ) TYPE=MyISAM COMMENT='Moodle configuration variables';");
+        notify("Created a new table 'config' to hold configuration data");
+    }
+
+    if ($oldversion < 2002072801) {
+
+    }
     return true;
 }