From: moodler Date: Sat, 5 Oct 2002 17:09:31 +0000 (+0000) Subject: Moved upgrade_moodle functions out to database-specific files, because X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=31f0900c61cc57a52f6043c9f0cc35e6a261fdbe;p=moodle.git Moved upgrade_moodle functions out to database-specific files, because the SQL is not compatible (nor is it possible to make it so). --- diff --git a/admin/index.php b/admin/index.php index 30447a6702..7f65db4aef 100644 --- a/admin/index.php +++ b/admin/index.php @@ -56,7 +56,8 @@ /// Check version of Moodle code on disk compared with database /// and upgrade if possible. - include_once("$CFG->dirroot/version.php"); # defines $version and upgrades + include_once("$CFG->dirroot/version.php"); # defines $version + include_once("$CFG->dirroot/lib/db/$CFG->dbtype.php"); # defines upgrades if ($CFG->version) { if ($version > $CFG->version) { // upgrade diff --git a/lib/db/mysql.php b/lib/db/mysql.php new file mode 100644 index 0000000000..79987e67c3 --- /dev/null +++ b/lib/db/mysql.php @@ -0,0 +1,81 @@ +config.php and remove all the unused settings (except the database, URL and directory definitions). See config-dist.php for an example of how your new slim config.php should look."); + } + if ($oldversion < 2002092000) { + execute_sql(" ALTER TABLE `user` CHANGE `lang` `lang` VARCHAR(5) DEFAULT 'en' NOT NULL "); + } + if ($oldversion < 2002092100) { + execute_sql(" ALTER TABLE `user` ADD `deleted` TINYINT(1) UNSIGNED DEFAULT '0' NOT NULL AFTER `confirmed` "); + } + + return true; +} + +?> diff --git a/lib/db/postgres7.php b/lib/db/postgres7.php new file mode 100644 index 0000000000..8cb8b6e6e0 --- /dev/null +++ b/lib/db/postgres7.php @@ -0,0 +1,25 @@ + diff --git a/version.php b/version.php index d04d31a44c..de5f4ea266 100644 --- a/version.php +++ b/version.php @@ -1,87 +1,11 @@ config.php and remove all the unused settings (except the database, URL and directory definitions). See config-dist.php for an example of how your new slim config.php should look."); - } - if ($oldversion < 2002092000) { - execute_sql(" ALTER TABLE `user` CHANGE `lang` `lang` VARCHAR(5) DEFAULT 'en' NOT NULL "); - } - if ($oldversion < 2002092100) { - execute_sql(" ALTER TABLE `user` ADD `deleted` TINYINT(1) UNSIGNED DEFAULT '0' NOT NULL AFTER `confirmed` "); - } - - return true; -} - -?>