From a8876884dc796b1d9934c603965d3e91c2845d2b Mon Sep 17 00:00:00 2001 From: martin Date: Mon, 29 Jul 2002 15:09:16 +0000 Subject: [PATCH] Now adds the config table automatically if there isn't one yet. --- admin/index.php | 6 +++++- version.php | 19 +++++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/admin/index.php b/admin/index.php index 0dd554ea02..0309fc3dd7 100644 --- a/admin/index.php +++ b/admin/index.php @@ -55,7 +55,11 @@ print_heading("Continue"); die; } else { - error("A problem occurred inserting current version into databases"); + if (upgrade_moodle(0)) { + print_heading("Continue"); + } else { + error("A problem occurred inserting current version into databases"); + } } } diff --git a/version.php b/version.php index 7198bf0b44..3d820f01ad 100644 --- a/version.php +++ b/version.php @@ -17,10 +17,25 @@ // 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; } -- 2.39.5